Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started