Question: Write a function named sum_some with three parameters: lower, upper and numbers, that returns the sum of the elements of the list numbers which are

Write a function named sum_some with three parameters: lower, upper and numbers, that returns the sum of the elements of the list numbers which are between lower and upper (inclusive). If the list numbers is empty then your function should return 0. Your function should satisfy the signature: int , int , list (int) -> int.

For example:

>>> sum_some (0 , 100 , []) 0 >>> sum_some (0 , 100 , [1,2,3,4,5]) 15 >>> sum_some (2 , 4 , [1,2,3,4,5]) 9 >>> sum_some (3 , 3 , [2,2,3,3,4,4]) 6

Your function should not use print or input at all.

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!