1for word1 in buf1:
2 find = False
3 for word2 in buf2:
4 ...
5 if res == res1:
6 print "BINGO " + word1 + ":" + word2
7 find = True
8 break # <-- break here too
9 if find:
10 break