with open('wordprob.txt', 'rt') as lines:
    with open('StdWord.txt', 'rt') as words:
        for line, word in zip(lines, words):
            a, b = (float(s) for s in line.split())
if a > b:
    pass
How to cleanly loop over two files in parallel in Python