Simple errors


#1

Need help. Don't know what is wrong. It does the requires function, but this seems to be the wrong answer.


choice = raw_input('Enjoying the course? (y/n)')

sa = "y" or "n"

while choice != sa:  
    choice = raw_input("Sorry, I didn't catch that. Enter again: ")


#2

if enter n the loop should end, this doesn't work:

i would simply compare at the while condition, since this gives you the opportunity to compare at both sides of the or operator:

while choice != "y" and choice != "n":

you should use a and keyword here, since invalid input will make both conditions true, where as valid input will make one condition true, the other false:

false or true # is true
false and true # is false

with or, then the loop will keep running


#3

yeah. Got it. Thanks a lot.


#4