Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python program to find smallest number in a list

# Python program to find smallest
# number in a list
 
# creating empty list
list1 = []
 
# asking number of elements to put in list
num = int(input("Enter number of elements in list: "))
 
# iterating till num to append elements in list
for i in range(1, num + 1):
    ele= int(input("Enter elements: "))
    list1.append(ele)
     
# print maximum element
print("Smallest element is:", min(list1))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Python #program #find #smallest #number #list
ADD COMMENT
Topic
Name
6+3 =