NameError: name 'yes' is not defined


#1

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

Error:
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"
else:
return "Sorry"

s=input("enter choice")
a=shut_down(s)
print


#2

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

Update***

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.


#3

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