4.) simple errors


#1

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

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

Hey guys why does "or" not work here? i know this is a basic question but im really curious in understanding why it doesnt work. Thanks ahead of time!


#2

Because choice !='y' or choice !='n' evaluates to True even when only one of the expressions on the left or right is True.

Assume that the user chooses 'y', then choice !='n' must be True and the entire expression is True because you have True on the right side of or.

Assume that the user chooses 'n', then choice !='y' must be True and the entire expression is True because you have True on the left side of or.


#3

Thank you so much!!!!