Smallest and Largest Number in a List

Python Tutorial to get smallest and largest number in a list.
list1 = [20, 50, 57, 100, 45, 67]
list1.sort()
print(list1[0],"= Smallest")
print(list1[-1],"= largest")
#Output
20 = Smallest
100 = largest

Leave a Reply