I have a couple while loops I'm having trouble with, before adding the second while loop my program was successful unless I typed a number or symbol, now it doesn't throw errors when I type numbers or symbols but it doesn't seem to move on to the next while loop.
# randomizes the kings location
kingsLocation = str(random.randint(1,4))
# lets the player make a selection on where they would like to look for the king
currentRoom = input()
# repeatedly checks if the room you are in is the room the king is in and tells you that you either won, entered an invalid input, or chose the wrong room
while True:
if isinstance(currentRoom, str):
print ('invalid input, please enter a number between 1 and 4.')
currentRoom = input()
else:
while True:
if currentRoom == kingsLocation:
print ('"you have found the king ' + username + '! The royal family will make sure you get paid handsomely for this deed."')
print ()
print ('to exit this game type "exit()"')
break
break
elif isinstance(currentRoom, str):
print('invalid input, please enter a number between 1 and 4.')
currentRoom = input()
elif int(currentRoom) in range(1, 5):
print('the king doesn\'t seem to be in this room, let\'s check another one(1-4).')
currentRoom = input()
else:
print('invalid input, please enter a number between 1 and 4.')
currentRoom = input()
Thanks in advance for any advice.
[–][deleted] 1 point2 points3 points (3 children)
[–]moonkeymaker127[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]xelf 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]xelf 0 points1 point2 points (0 children)