Computer Science, asked by adityak4m6le007, 1 month ago

Write a program to find the largest and the smallest number in a list. ( given by the user)​

Answers

Answered by PrateekBairagi
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 ISHWARI082421
5

Answer:

ky re ky question vichar lelas ?

Explanation:

kashya varun pn download hot nahi ye

Similar questions