View Single Post
Old Jul 10th, 2007, 1:12 PM   #9
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Cool

Quote:
(Note that one space between each column was added by the way print works: it always adds spaces between its arguments.)
Whoever wrote that is full of dung, as it pertains to formatted strings. The space that you have in this example is the one from the format string.

Look at this:
for i in range(1, 6):
    print "%d-->%d" % (i, i*i)
"""
result (no spaces) ...
1-->1
2-->4
3-->9
4-->16
5-->25
"""
__________________
I looked it up on the Intergnats!

Last edited by Dietrich; Jul 10th, 2007 at 1:34 PM. Reason: sample code added
Dietrich is offline   Reply With Quote