Traceback error


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

Enjoying the course? (y/n) n
Traceback (most recent call last):
File "python", line 3, in
NameError: name 'y' is not defined


The inputs will be string type.

while choice != 'y' ...


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