Question: 1. (8 points) Write Python code to define the following function. Use pythontutor.com to check that your code does what it should. Submit a screenshot

1. (8 points) Write Python code to define the following function. Use pythontutor.com to check that your code does what it should. Submit a screenshot of your code.

Write a function sumOfCubes(List)that computes the sum of the cubes of the numbers in the List and returns the result.

Make sure to write your code so that it works no matter how many items are in the list. Examples: sumOfCubes([1, 3, 4]) returns 92 (because 1 + 27 + 64 = 92) sumOfCubes([2, -3, -1]) returns 20 (because 8 27 1 = 20).

def sumOfCubes( List ):

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!