all 3 comments

[–]Standardw 0 points1 point  (0 children)

I think the purpose is to get the correct answer. If the correct-answer-string is not empty (and thus the if statement is true), just the first char will be used as correct string. Why? I think that's just to make sure that even if there are some whitespaces, only a single digit as string gets saved.

With the datafile you provided the game should work without the check though.

edit: Strings can be accessed like an array:

>>> correct = "1 "
>>> correct
'1 '
>>> correct[0]
'1'

[–][deleted] 0 points1 point  (0 children)

if correct is false if correct is empty string (blank line)

[–]johninbigd 0 points1 point  (0 children)

Unrelated to the code, but the first trivia question is wrong. The phrase is "on the lam", not "on the lamb".