how to turn readlines into a string... perhaps?
<p>I think my largest problem is I don't know how to ask the question of what it is exactly that I am looking for.</p>

<p>I stole most the code from a flashcard program from <a href="http://www.tuxradar.com/content/code-project-build-flash-card-app" rel="nofollow">http://www.tuxradar.com/content/code-project-build-flash-card-app</a> and modified it a bit to suit my own needs.  However, when I get the answer correct it still says I've gotten it wrong.<br>
Here is my code:</p>

<pre><code>#!/usr/bin/env python
import os
import random
import time

file1 = open('/root/first.txt', 'w')
file2 = open('/root/second.txt', 'w')

file1.writelines('1\n2\n3\n4\n5')
file2.writelines('0,2\n1,3\n2,4\n3,5\n4,6')

time.sleep(1)

file1.close
file2.close

time.sleep(1)

file1 = open('/root/first.txt', 'r')
file2 = open('/root/second.txt', 'r')

count = 0
score = 0
tries = int(raw_input('How many tries?'))
start_time = time.time()

f1content = file1.readlines()
f2content = file2.readlines()

try:
    while count &lt; tries:
        os.system('clear')

        wordnum = random.randint(0, len(f1content)-1)
        correct = str(f2content[wordnum])

        print 'Number:', f1content[wordnum], ''

        answer = input('\nSurrounding numbers?')

        if answer == correct:
            raw_input('\nCorrect! Hit enter...')
            score = score + 1
        else:
            print '\nNope, It\'s', correct
            raw_input('Hit enter to try a new one...')

        count = count + 1

except SyntaxError:
    print 'you must enter a value, starting over'
    os.system('./flash.py')

finally:
    file1.close
    file2.close
    os.system('rm /root/first.txt')
    os.system('rm /root/second.txt')

stop_time = time.time() - start_time
print '\nIt took you', stop_time / 60, 'minutes to get', score, 'out of', count, 'correct'
</code></pre>

<p>I postulate that my problem lies in Line 35 where I define correct as </p>

<pre><code>correct = str(f2content[wordnum])
</code></pre>

<p>The reason I think this is because if it gives me <code>1</code> and I know that the correct answer is <code>0,2</code> and I type that in, it say's nope, it's <code>0,2</code>.  This suggests that in plain text it is the exact same to the human eye but that the computer is reading it as something different. I tried to make it a string because of this and making it an interger causes an error. I'm really stuck and am sure it's something so simple but I am just not seeing it.  Any help would be appreciated.  Even if it is just a point in the right direction of where I can find the answer.  </p>
