while True: #asking the player how many questions they want rounds_number = input('How many questions do you want?(pick a number from 5-20) ') #checking if the player entered a number grater then 5 but lesser than 20 if not rounds_number.isdigit() or not 5 <= int(rounds_number) <= 20: print('choose a number between 5 and 20') continue else: break