Python program to Print Largest and Smallest Number

number=[54,67,43,89,21,34]
#sorting the list
number.sort()
#print the last element in the list for largest
print("largest elements is: ",number[5])
#print the first element in the list for smallest
print("Smallest elements is: ",number[0])

OUTPUT:

largest elements is: 89
Smallest elements is: 21

Leave a Comment