Question: program is python pycharm Part V: Sum Squares and Cubes (20 points) Write a function sum.them () that sums a set of integers, each of
program is python pycharmPart V: Sum Squares and Cubes (20 points) Write a function sum.them () that sums a set of integers, each of which is the square or cube of a provided integer. Specifically, given an integer n from a list of values, add na to the total if the number's index in nums is even; otherwise, the index is odd, so add n to the total. The function takes one argument: nums: a list of integers to process according to the above description As an example, for the argument (5, 2, 3], the function would return 42 because 52 + 23 + 32 = 42. In the case that the input list is empty, the function returns 0. Examples: Function Argument Return Value [-1, -8, -41 [8, 6, 1, 3, 2) [0, 1, 7, -3) [5] [5, 2, 3] -495 312 23 25 42
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
