Take a look at Why does the second for loop only iterate once?.
While the OP's code is a wall of text, the problem doesn't need to be that long. I have one and it is more simple. I think for the sake of later visitors I should change the question to mine code.
Should I?
One other problem if the answer for the above question is "yes", is the already answers based on the OP's code. So that if I change the code in the question, I should change it in the answers as well. If there are only one or two answers, I can take my time on that. But if it has more answers, well...
My proposed version:
The text.txt:
a A b B c C
A simple
for
infor
:for word in ['a','b','c']: print(word) for line in text.txt: if line==word: print(word,line)
Result:
a A b c
Why is that?