I get the initial "Are you enjoying the course" question, but when I answer, something weird happens. For example, I'll answer "f" to test the code, and the output will spit out "y" or "n" and I have to answer again. The code is not consistent and I'm very confused. I need to know what I'm doing wrong because this exercise is affecting my ability to do other exercises.
I expected that I only had to enter my answer once, unless it wasn't 'y' or 'n'.
Replace this line with your code. choice = raw_input('Enjoying the course? (y/n)') choice == 'y' and 'n' while choice != raw_input('y') and choice != raw_input('n'): choice = raw_input("Sorry, I didn't catch that. Enter again: ") if choice == 'y': print "Glad to hear!" elif choice == 'n': print "Sorry to hear."