I want my program to say 'invalid input' if 2 digits or more are entered so is there a way i can limit my users input to a single digit in python?
This is my code:
print('List Maker')
tryagain = ""
while 'no' not in tryagain:
list = []
for x in range(0,10):
number = int(input("Enter a number: "))
list.append(number)
print('The sum of the list is ',sum(list))
print('The product of the list is ',sum(list) / float(len(list)))
print('The minimum value of the list is ',min(list))
print('The maximum vlaue of the list is ',max(list))
print(' ')
tryagain = input('Would you like to restart? ').lower()
if 'no' in tryagain:
break
print('Goodbye')