I am asking a user to type either 1 or 2, and if they don't enter a valid response, I prompt the input again. However, when I run this code, and there is an invalid input, it prompts them again, but if their new input is valid, it continues to prompt them again rather than carry out the code for the correct inputs.
userInputB = int(input("Enter '1' if you would like to get out of bed, or '2' if you would like to sleep in: "))
while True:
if userInputB == 1:
print("Great! Let's move on.")
break
elif userInputB == 2:
print("Okay. You have decided to sleep in for five more minutes.")
for i in range(5,0,-1):
print(i,'...')
break
while userInputB != 1 or userInputB != 2:
print("Invalid Response.")
userInputB = int(input("Enter '1' if you would like to get out of bed, or '2' if you would like to sleep in: "))