Thursday, 16 December 2021

To find the largest and smallest numbers in a list.

 lst = []

num = int(input('How many numbers: '))for n in range(num):
numbers = int(input('Enter number '))
lst.append(numbers)
print("Maximum element in the list is :", max(lst), "\nMinimum element in the list is :", min(lst))

Output :

Smallest and Largest element in list - programminginpython.com

No comments:

Post a Comment