Question: Exercise 5 Use the function design recipe to develop a function named sum13. The function takes a list of integers, which may be empty. The

 Exercise 5 Use the function design recipe to develop a function

Exercise 5 Use the function design recipe to develop a function named sum13. The function takes a list of integers, which may be empty. The function returns the sum of the numbers in the list, returning 0 for an empty list. The number 13 is very unlucky, so any 13 in the list is not counted, and any number that comes immediately after a 13 is not counted. For example, when the function's argument is [1, 2, 2, 1, 13], the function returns 6. When the function's argument is [13, 1, 2, 13, 2, 1, 13], the function returns 3

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 Programming Questions!