Simple errors


Hello, I need help with this.

I wrote the following code:

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: ")

and the answer on the window console showed my code work fine, but it won't let me go on to the next quiz.

What am I doing wrong. Please help.


Logic... AND instead of OR.



I tried both 'and' and 'or'.

The answers in the window console show either one works.

But the system still won't let me pass to the next quiz.

Is it a bug ?


Not that I am aware of. This is a very old course.

Recall that while depends upon truthiness in its conditional expression or it either won't execute, or it will terminate.


can be truthy when the input is not "y". That means the expression is short circuited and and the second operand doesn't even get looked at.

We need an expression that MUST not short-circuit on TRUE, meaning AND.


This will short circuit on "y" or "n" as inputs (short circuits on FALSE).

Please post a link to the exercise if you are still stuck.


Thank you.

It still does not work.

I have tried "and" (see below) and many other variations, but each time the "submit and save" button greys out and the screen freezes. Please help.

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

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



Careful you do not interpret my pseudo-code directly. Syntax rules still apply...

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

They are string literals, after all.


Hello, thanks again for the prompt response.

That was one of the variations I tried. It does not work, the "save and submit" button remains grayed out when I try to respond to the y/n question on the windows console. I tried undoing and refilling the code, rebooting the computer, and reentering codecademy, none of that worked either.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.