Python Forum
Unexpected input in While Loop - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Unexpected input in While Loop (/thread-9960.html)



Unexpected input in While Loop - fier259 - May-06-2018

Hi guys, I'm trying to learn how to do while loops and came across a problem. No errors show up in my code but when I run it, it doesn't ask the input in my while loop. It would be awesome if someone could help me figure this out. [python]
valid = {'1', '2', '3'}
while False:
advantage = input("Do you pick extra health [1], extra luck [2], or extra power [3[").strip()
if advantage in valid:
print("Your stats have been updated")
else:
print("Invalid input, try again")
break
[python]

Thank you for your consideration


RE: Unexpected input in While Loop - woooee - May-07-2018

The you debug it

valid = {'1', '2', '3'}
print("before while")
while False:
    print("in while")