In this example, you will find smallest and largest number from list.
Example :
# Python program to smallest and largest number from list
list1 = [1,12,31,4,56,36,71,28,9]
print("Smallest value element : ", min(list1))
print("Largest value element : ", max(list1))
Output :
Smallest value element : 1
Largest value element : 71
Explanation :
Python list method max() returns the element from the list with maximum value while python min() function returns smallest element from list.
Ask anything about this examples