I need to make a change calculator in python and I want to make it so the user cannot input letters or symbols, I have tried lots of things and I can't get it to work. I have used a while loop to stop the user from inputting anything below 0.01 and so it must be possible to do this for letters.
given = float(input("How much money was given?\n"))#Asks for the amount of money given
while given < 0.01:#Prevents any digits 0 or lower from being inputted
print("That is not a valid amount")
given = float(input("How much money was given?\n"))
if given > 0.01:
break
while True:#Prevents anything not a digit from being inputted
print("That is not a valid option")
while given.isalpha():#Prevents anything not a digit from being inputted
print("That is not a number")
given = float(input("How much money was given?\n"))
the error message says that it cannot change string to integer/float
some other bits don't work because i tried different things from online but i particularly need help with the bit i asked about. Thanks again