Please help me understand this code
<p>I'm having trouble understanding the <code>correct</code> variable in the <code>next_block(the_file)</code> function. The program won't work correctly if the <code>correct</code> variable is not indexed. Hence, <code>correct[0]</code>. So my question is why doesn't it work correctly if it's not indexed and why can it even be indexed if an integer is not subscriptable.</p>

<p>The text file it uses is this:</p>

<pre><code>An Episode You Can't Refuse
On the Run With a Mammal
Let's say you turn state's evidence and need to "get on the lamb." /If you wait too long, what will happen?
You'll end up on the sheep
You'll end up on the cow
You'll end up on the goat
You'll end up on the emu
1
A lamb is just a young sheep.
The Godfather Will Get Down With You Now
Let's say you have an audience with the Godfather of Soul. /How would it be smart to address him?
Mr. Richard
Mr. Domino
Mr. Brown
Mr. Checker
3
James Brown is the Godfather of Soul.
</code></pre>

<p>And this is the code:</p>

<pre><code># Trivia Time
# Trivia game that reads a plain text file

def open_file(file_name, mode):
    """Open a file."""
    try:
        the_file = open(file_name, mode)
    except(IOError), e:
        print "Unable to open the file", file_name, "Ending program.\n", e
        raw_input("\n\nPress enter to exit..")
        sys.exit()
    else:
        return the_file

def next_line(the_file):
    """Return the next line from the trivia file, formatted."""
    line = the_file.readline()
    line = line.replace("/", "\n")
    return line

def next_block(the_file):
    """Return the next block of data from the trivia file."""
    category = next_line(the_file)

    question = next_line(the_file)

    answers = []
    for j in range(4):
        answers.append(next_line(the_file))

    correct = next_line(the_file)
    if correct:
        correct = correct[0]

    explanation = next_line(the_file)

    return category, question, answers, correct, explanation

def welcome(title):
    """Welcome the player and get his/her name."""
    print "Welcome to Trivia Challenge!\n"
    print title, "\n"

def main():
    trivia_file = open_file("trivia.txt", "r")
    title = next_line(trivia_file)
    welcome(title)
    score = 0
    # get first block
    category, question, answers, correct, explanation = next_block(trivia_file)
    while category:
        # ask a question
        print category
        print question
        for j in range(4):
            print j + 1, "-", answers[j]
        # get answer
        answer = raw_input("What's your answer?: ")
        # check answer
        if answer == correct:
            print "\nRight!",
            score = score + 1
        else:
            print "\nWrong.",
            print explanation
            print "Score:", score, "\n\n"
        # get next block
        category, question, answers, correct, explanation = next_block(trivia_file)
    trivia_file.close()
    print "That was the last question!"
    print "Your final score is:", score

main()
raw_input("\n\nPress the enter key to exit.")
</code></pre>
