Python program to find smallest number using for loop

l = [ ]
num = int(input(“Enter num of element”))
for i in range (1, num+1):
ele = int(input(“Enter elements”)
print(“Smallest element is:” , min(l))



correct, keep it up.

Good, Keep it up… try it using loop also.

There are various way to solve this problem .
1.) using min which you have done.
2.) you can sort the list and print the first element

1 Like