Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

More Books

Students also viewed these Databases questions

Question

What type of office space and equipment are provided?

Answered: 1 week ago