min max list python code example

Example 1: python maths max value capped at x

def clamp(n, minn, maxn):
    return max(min(maxn, n), minn)

Example 2: how to make a python script write the minimum and maximum value

how to make a python script write the minimum add maximum value

Example 3: python list max value

#!/usr/bin/python

list1, list2 = [123, 'xyz', 'zara', 'abc'], [456, 700, 200]
print "Max value element : ", max(list1)
print "Max value element : ", max(list2)