variables[2]<4
will always be False at the second iteration.
since variables[2]
is a string after the line variables = (line.strip().split())
and 4
is an int
and in python 2.x while string < int
will result as False
you can read more about your mistake here