val = [*range(1,51)]
print("Now, I need aaato know how many state Capitals you would like to practice")
user = input("chose a number from 1 to 50")
while user not in val:
print("There are 50 States in the United States. You need to pick a number between 1-50. If you want to exit the game, type \"EXIT\"")
user = input("I needbbb to know how many state Capitals you would like to practice")
if user.capitalize() == "EXIT":
break
if user == 0:
print("There are more than zero States in the United Sts That means that you do not want to play today")
user = input("I needccc to know how many state Capitals you would like to practice. If you want to exit the game, type \"EXIT\"")
print("Hello")
output:
There are 50 States in the United States. You need to pick a number between 1-50. If you want to exit the game, type "EXIT" I needbbb to know how many state Capitals you would like to practice0 There are 50 States in the United States. You need to pick a number between 1-50. If you want to exit the game, type "EXIT" I needbbb to know how many state Capitals you would like to practice5 There are 50 States in the United States. You need to pick a number between 1-50. If you want to exit the game, type "EXIT" I needbbb to know how many state Capitals you would like to practice123 There are 50 States in the United States. You need to pick a number between 1-50. If you want to exit the game, type "EXIT" I needbbb to know how many state Capitals you would like to practice5 There are 50 States in the United States. You need to pick a number between 1-50. If you want to exit the game, type "EXIT" I needbbb to know how many state Capitals you would like to practice0 There are 50 States in the United States. You need to pick a number between 1-50. If you want to exit the game, type "EXIT" I needbbb to know how many state Capitals you would like to practiceexit There are 50 States in the United States. You need to pick a number between 1-50. If you want to exit the game, type "EXIT" I needbbb to know how many state Capitals you would like to practice
I created a list with ints between the number 1 and 50. I want the user to pick a number from the list (val). If it's not there, I want the user to keep trying. Unless the user wants to quit with "EXIT".
It just keeps getting stuck in my user input print statement and I dont understand why?