KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Ok, so I'm writing a grade checking code in python and my code is: unit3Done = str(input("Have you done your Unit 3 Controlled Assessment? (Type y or n): ")).lower() if unit3Done == "y": pass elif unit3Done == "n": print "Sorry. You must have done at least one unit to calculate what you need for an A*" else: print "Sorry. That's not a valid answer." When I run it through my python compiler and I choose "n" , I get an error saying: "NameError: name 'n' is not defined" and when I choose "y" I get another NameError with 'y' being the problem, but when I do something else, the code runs as normal. Any help is greatly appreciated, Thank you.
Tags (comma-separated)
Save Edits
Cancel