I'm trying to use while
with not
and or
, but for some reason my code doesn't work.
orientation = ""
while orientation is not "h" or "v":
print("Type 'h' for horizontal and 'v' for vertical")
orientation = input()
if orientation == "h":
do_something()
if orientation == "v":
do_something()
The expected outcome would be, if I was to type "h" or "v" into the input, do_something()
would be called and the while loop would end, but instead, the while loop continues, and repeats. What am I doing wrong?