I have tried so many variations here to no avail. I have a menu with 4 options, I'm trying to loop if options 1, 2, 3 or 4 is not selected whilst printing out a response and reprompting a choice of only 1, > 2, 3 or 4. I've tried:
print("Options:")
print("Option 1")
print("Option 2")
print("Option 3")
print("Option 4")
choice = int(input("What would you like to choose [1,2,3,4]? "))
while choice not in ['1','2','3','4']:
print: ("Please enter 1, 2, 3 or 4. ")
choice = int(input("What would you like to choose [1,2,3,4]? "))
and
print("Options:")
print("Option 1")
print("Option 2")
print("Option 3")
print("Option 4")
choice = input("What would you like to choose [1,2,3,4]? ")
while choice not '1' and choice not '2' and choice not '3' and choice not '4':
print: ("Please enter 1, 2, 3 or 4. ")
selection = input("What would you like to choose [1,2,3,4]? ")
and
print("Options:")
print("Option 1")
print("Option 2")
print("Option 3")
print("Option 4")
choice = int(input("What would you like to choose [1,2,3,4]? "
while choice != '1' and user_input != '2' and user_input != '3' and choice != 4:
choice = int(input("Please enter 1, 2, 3 or 4. "))
I'm getting a range or errors from syntax errors to incorrect output (will not print "Please enter 1, 2, 3 or 4. " and will not loop. Only after something very simple, don't want to use a quit statement - where am I going wrong here please?