Simple errors - repeats the sentence twice


#1

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?


#2

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.


#3

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