Traceback error


#1



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


#2

The inputs will be string type.

while choice != 'y' ...

#3

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