NameError: name 'yes' is not defined


Getting error please help.
If I enter yes in quotes i get correct output.
Why do i need to enter my input in quotes??

enter choice: yes

Traceback (most recent call last):
File "python", line 9, in
File "", line 1, in
NameError: name 'yes' is not defined

def shut_down(s):
if s=='yes':
return "Shutting down"
elif s=='no':
return "Shutdown aborted"
return "Sorry"

s=input("enter choice")


after print in last line of code?
What to print?
Also indent your code.


Delete last three lines of code.
Its not needed!
All testing is done by Codecademy Editor so you don't need to get user's input and test it.


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