[Tutor] 'print' without newline or space appended
marcink at ieee.org
Sun Sep 25 16:20:46 CEST 2005
for c in 'hello': print c
will generate following output:
and by adding comma at the end of the print statement:
for c in 'hello': print c,
we get this output:
h e l l o
How do I output something using 'print' such that there is no new line or
space appended at the end of the output.
Hehe... just answered my own question:
for c in 'hello' : sys.stdout.write(c)
Is this the way to do it or is there a more appropriate approach.
More information about the Tutor