SNHU-IT-140/3/3.11 Smallest Number/smallest_number/main.py

17 lines
402 B
Python

def get_input():
result = []
print('Enter a number when prompted. Press enter to stop')
while True:
_input = input('Input a number: ')
if len(_input) == 0:
break
try:
_input = int(_input)
result.append(_input)
except ValueError:
print("Error, only accepts numbers")
return result
print(min(get_input()))