Print on the same line

Any more elegant ways to do it?