Fix the given mistake in the code and explain what it does.
Input: for x in range(10):
    print x
for x in range(10): 
    print("{}\n".format(x)) 
    # Some code that modifies 'x' 
for x in range(10):
    print(x)
The code should be written as for x in range(10):
    print('x',x)