logo CodeStepByStep logo


Language/Type: Python lists

Write a function named list_range that returns the range of values in a list of integers. The range is defined as 1 more than the difference between the maximum and minimum values in the list. For example, if a list called nums contains [36, 12, 25, 19, 46, 31, 22], the call of list_range(lis) should return 35. You may assume that the list has at least one element. You should not modify the contents of the list.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.