I'm learning python at this moment and i was wondering how i can make python ask the user to fill in a other number if the user didn't fill in a number but a word. Below is my code how i have it now my guess is that i have to put it somewhere in the Except part, but i don't know what. Thanks in advance
numlist = list()
try:
while True :
inp = input('Enter a number ')
if inp == 'Done' : break
value = float(inp)
numlist.append(value)
Average = sum(numlist) / len(numlist)
except:
print ('This is not a number, please enter a number')
print ('The average is: ', Average)