Question: Part 1 #Write a function SUM() that returns the sum of all numbers in the given list my_list #Expected output: 10 'Your function definition goes

 Part 1 #Write a function SUM() that returns the sum of

Part 1 #Write a function SUM() that returns the sum of all numbers in the given list my_list #Expected output: 10 'Your function definition goes here" my_list = [1,2,3,4] print("The sum of all numbers in my_list is:", SUM(my_list)) Part 2 #Create a function showLifespan() that accepts an animal's name and it's lifespan and prints both. #If the lifespan is missing in the function call, showLifespan() should print it as a default value of 5. #For example input: showLifespan("giraffe", 26) the expected output is: "The lifespan of giraffe is 26 years" #For example input: showLifespan("cat") the expected output is: "The lifespan of cat is 5 years" 'Your function definition goes here" showLifespan("giraffe", 26) showLifespan("cat")

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!