Question: (Python) 1) Implement a function that takes in a list of Number as the first parameter, and a single Number as its second parameter. Using

(Python)

1) Implement a function that takes in a list of Number as the first parameter, and a single Number as its second parameter. Using a While loop, start summing the elements of the list but make sure that the summation does not pass the second parameter. The second parameter is essentially the limit. This function should return 2 items. First item is the actual sum of the elements, and this item should always be equal or less than the second parameter. The second item is the list of numbers that you actually summed up, so this should be a subset of the first parameter.

2) Implement question 1, but using a For Loop instead of a While Loop

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!