python find a range in a list code example
Example 1: get range of items of python list
names = ['Alice', 'Bob', 'Tom', 'Grace']
names[1:3]
# Output:
# ['Bob', 'Tom']
Example 2: find the range in python
def find_range(n):
lowest = min(n)
highest = max(n)
# Find the range
r = highest - lowest
return lowest, highest, r
# src : Doing Math With Python