Question: [4] The following Python program is given. Explain the purpose of the function in one sentence. What is the output for the given list?
[4] The following Python program is given. Explain the purpose of the function in one sentence. What is the output for the given list? #function definition def doSomething (theList): sum = 0 for v in theList: sum = sum + V return sum # function call 1st = [1, 5, -4, 25, 30, 0, -10] print (doSomething (1st))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
