Using zip can provide a better solution:
for i, (a, b) in enumerate(zip(*f)): if a != b: print i
zip(*f) gives you:
In [18]: zip(*f) Out[18]: [(3, 7), (5, 5), (6, 6), (7, 3)]
And now you can easily compare the "columns".
If you are a guy with one liner:
[i for i, (a, b) in enumerate(zip(*f)) if a != b]
source share