Python Forum

Full Version: inserting input gives me error message
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I keep getting this error message
Error:
Traceback (most recent call last): File "U:/Computer Programming/Python/Quiz how.py", line 3, in <module> if (answer_1 == Flat): NameError: name 'Flat' is not defined
My Code is
score = 0
answer_1 = input("What is the shape of the Earth?")
if (answer_1 == Flat):
    print("You got it right")
    score = score + 1
    print("Your Score is:", score)
else:
    print("You are incorrect, The answer was Flat")
    print("Your Score is:", score)
please help me
please, read https://python-forum.io/Thread-Python3-2...-raw-input

I overlooked the traceback. See the answer in next post
quotation marks are missing

if (answer_1 == "Flat"):
Oh, I overlooked that.