Well, I'm pretty new to programming and I need some help with this code.
roundvalue = True
rounds = 0
while roundvalue == True:
rounds= input("Pick a number of rounds (3 or 5)")
try:
int(rounds)
except ValueError:
try:
float(rounds)
except ValueError:
print ("This is not a number")
if rounds == 3:
print("You chose three rounds!")
roundvalue = False
elif rounds == 5:
print ("You chose 5 rounds")
roundvalue = False
else:
print ("Input again!")
The point of the code is to select a number of rounds and if the user inputs anything else (Letters or numbers that are not 3 or 5) it should repeat the question. *(My code just currently repeats 'Pick a number of rounds (3 or 5)'