Write a program to find the largest and the smallest number in a list. ( given by the user)
Answers
Answered by
1
Answer:
l=[]
num = int(input("Enter number of elements you want to add in the list:"))
for i in range(1, num + 1):
e= int(input("Enter elements:"))
l.append(e)
print("Smallest element is:", min(l))
print("largest element is:", max(l))
Explanation:
Make a empty list
take number of elements you want to add in the list from user
use range
take all the elements from user
append in the empty list
print by using max() and min()
And done
hope it's help you
Answered by
5
Answer:
ky re ky question vichar lelas ?
Explanation:
kashya varun pn download hot nahi ye
Similar questions
Computer Science,
28 days ago
Social Sciences,
28 days ago
Social Sciences,
1 month ago
English,
1 month ago
Math,
8 months ago