Because the output stream is line-buffered - since it's not explicitly being flushed in between print statements, it waits until it sees a newline to flush the output.
You can force flushing via sys.stdout.flush().
Alternatively if you run Python with the -u flag, it will disable line buffering.