这段代码合法吗?
def ask_to_leave():
if answer == 'y':
return False
elif answer == 'n':
return True
我收到此错误:
Traceback (most recent call last):
File "MACROCALC.py", line 62, in <module>
main()
File "MACROCALC.py", line 17, in main
answer = input("Are you done using the calculator?(y/n)")
File "<string>", line 1, in <module>
NameError: name 'y' is not defined
这是我的代码的链接