Python program to find maximum and minimum element into list.

 Code:-

print(“Enter element of the list”)
mylist=list(map(int,input().split()))
max=min=mylist[0]
for i in mylist:
if(max<i):
max=i
if(min>i):
min=i
print(“Maximum element is: “,max)
print(“Minimum element is:”,min)

Output:-

Enter element of the list
12 3 4 5 76 89 98 1 6
Maximum element is: 98
Minimum element is: 1



Leave a Reply

Your email address will not be published.