Simple errors - repeats the sentence twice


The code (which got accepted) is this:
choice = raw_input(‘Enjoying the course? (y/n)’)

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

And the output is this:
Enjoying the course? (y/n)8
Sorry, I didn’t catch that. Enter again: Sorry, I didn’t catch that. Enter again:

why does it repeat the sentence twice?


There seems to be something wrong. I’ve tried running your code through the Python 2.7.6 interpreter and everything seems to be working fine.
You may want to fill a bug report.

Tip: You can keep your text formatted the way you entered it by pressing Ctrl+Shift+C. That’s really useful when using Python. It is pretty picky about indentation.


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