Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to print smallest number in python

# creating empty list
lis = []

# user enters the number of elements to put in list
count = int(input('How many numbers? '))

# iterating till count to append all input elements in list
for n in range(count):
    number = int(input('Enter number: '))
    lis.append(number)

# displaying smallest element
print("Smallest element of the list is :", min(lis))
Source by beginnersbook.com #
 
PREVIOUS NEXT
Tagged: #print #smallest #number #python
ADD COMMENT
Topic
Name
5+1 =