Traceback (most recent call last):
File "python", line 9, in
File "", line 1, in
NameError: name 'yes' is not defined
So, I just want to put an input question before the code, but I can't see wtf is going wrong.
I need some help here, and sorry for my bad English.
Replace this line with your code. def shut_down(s): if s == "yes": return "Shutting down" elif s == "no": return "Shutdown aborted" else: return "Sorry" s = input("Do you want to shut_down the program? yes or no?") print shut_down(s)