Sorry for the non descriptive question I had no idea how to word it.
I'm trying to write a program (GUI) where I ask the users questions and then in return they answer and see if they are correct however when I enter the correct answer it's still showing as being incorrect.
My code looks something like this.
prompt for question 1
txtQuestion = Text(Point(5,8), "Question 1")
txtQuestion.setTextColor("red")
txtQuestion.setSize(16)
txtQuestion.setStyle("bold")
txtQuestion.draw(win)
txtAnswer = Text(Point(1.5,4), "Answer 1: ")
txtAnswer.setTextColor(color_rgb(255,127,80))
txtAnswer.setSize(14)
txtAnswer.setStyle("bold")
txtAnswer.draw(win)
txtAnswer2 = Text(Point(1.5,3), "Answer 2: ")
txtAnswer2.setTextColor(color_rgb(255,127,80))
txtAnswer2.setSize(14)
txtAnswer2.setStyle("bold")
txtAnswer2.draw(win)
txtAnswer3 = Text(Point(1.5,2), "Answer 3: ")
txtAnswer3.setTextColor(color_rgb(255,127,80))
txtAnswer3.setSize(14)
txtAnswer3.setStyle("bold")
txtAnswer3.draw(win)
txtAnswer4 = Text(Point(1.5,1), "Answer 4: ")
txtAnswer4.setTextColor(color_rgb(255,127,80))
txtAnswer4.setSize(14)
txtAnswer4.setStyle("bold")
txtAnswer4.draw(win)
txtEnterAn = Text(Point(8,3), "Enter your answer below: ")
txtEnterAn.setTextColor("black")
txtEnterAn.draw(win)
entAnswer = Entry(Point(8,2), 3)
entAnswer.draw(win)
Answer1 = entAnswer.getText()
win.getMouse()
#loop for answer
if Answer1 == "A":
txtCorrect = Text(Point(5,9), "Correct!")
txtCorrect.setTextColor("black")
txtCorrect.draw(win)
else:
txtCorrect = Text(Point(5,9), "Inorrect!")
txtCorrect.setTextColor("black")
txtCorrect.draw(win)
Now I'm not sure why every time I enter "A" it still shows as incorrect I know in another program I had to float the entAnswer variable but I figured this time I wouldn't have to since it's a string.
I must be overlooking the situation but I can't lay my finger down on it, any help would be appreciated, thanks!
p.s. I didn't put it in with the code but I do have the variables up top initialized such as Answer1 = " " and so forth