Loop and compare the input from console


#1

choice = raw_input('Enjoying the course? (y/n)')
print choice
while choice != "y" or choice != "n": # Fill in the condition (before the colon)
choice = raw_input("Sorry, I didn't catch that. Enter again: ")

Note: while choice != "y" or choice != "n" condition always meet . What is wrong? Thanks!


#2

Let's say choice is 'n'.

What happens in an OR expression when the first operand is,

choice != "y"

?


#3

program will run inside of the loop choice = raw_input("Sorry, I didn't catch that. Enter again: "), when choice is 'y' then program should stop, am I right? Thank you for your help!


#4

Well, I'm not going to confirm that, just yet. Consider...

or T F
 T T T
 F T F

While we're at it, consider,

and T F
  T T F
  F F F

#7