Home on the Range

Write a function called listrange() that will return the range of a list of numbers.

The function will receive a Python list passed in as a parameter. The range of a list is the difference between the maximum value and the minimum value of the list.

You may assume that the list will always have at least two values.

Examples:

Bonus

For +20 bonus points, make your function work no matter what kind of numbers are in the list. Even if the numbers are in the billions or are all negative, your code should still be able to find the largest and smallest values correctly.




©2017 Graham Mitchell