python get the max three values in a list code example
Example 1: return maximum of three values in python
def maximum(a,b,c):
max_val = a
if b > max_val:
max_val = b
if c > max_val:
max_val = c
return max_val
Example 2: 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)