I am in the process of learning Python, very much a beginner, and trying to make a simple quiz. However, this simple code does not work, and I cannot figure out what is wrong. I am using PyCharm community edition IDLE.
/home/steven/PycharmProjects/practice/venv/bin/python /home/steven/PycharmProjects/practice/practicefile
Answer Here: a
Any advice greatly appreciated.
answer = input("Answer Here: ") if answer == "a": print("a") elif answer == "An": print("An") else: print("incorrect")I input a into the input and get this:
/home/steven/PycharmProjects/practice/venv/bin/python /home/steven/PycharmProjects/practice/practicefile
Answer Here: a
Error:Traceback (most recent call last):
File "/home/steven/PycharmProjects/practice/practicefile", line 1, in <module>
answer = input("Answer Here: ")
File "<string>", line 1, in <module>
NameError: name 'a' is not defined
Process finished with exit code 1Any advice greatly appreciated.