Write a Python program that asks users to input 10 float numbers (using a while statement), and print the minimum number.
# python code
import sys
i = 0
min = sys.float_info.min
while True:
number = float(raw_input("Enter a number: "))
if number < min:
min = number
i = i + 1
if i == 10:
break
print "\nMinimum number: ", min
'''
output:
Enter a number: 4
Enter a number: 5
Enter a number: -1
Enter a number: -10.6
Enter a number: 55.4
Enter a number: -0.56
Enter a number: -4.2
Enter a number: 10
Enter a number: 5
Enter a number: 6
Minimum number: -10.6
'''
Get Answers For Free
Most questions answered within 1 hours.