This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: False sentence about formatted print in tutorial section 7.1
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: dbenbenn, georg.brandl
Priority: normal Keywords:

Created on 2006-09-28 23:15 by dbenbenn, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg30052 - (view) Author: David Benbennick (dbenbenn) Date: 2006-09-28 23:15
The line:

(Note that one space between each column was added by
the way print works: it always adds spaces between its
arguments.)

in section 7.1 of the tutorial
(http://docs.python.org/dev/tut/node9.html), is false.
 It refers to the command

print '%2d %3d %4d' % (x, x*x, x*x*x)

which produces (if x == 10)

10 100 1000

The two spaces in that output are NOT "added by the way
print works".  Instead, they come from the format
string itself.  If you use

print '%2d%3d%4d' % (x, x*x, x*x*x)

you get

101001000
msg30053 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-09-30 07:25
Logged In: YES 
user_id=849994

The sentence refers to the example above the one you quoted,
which uses the print statement. I made that clear in rev
52053, 52054 (2.4), 52055 (2.5).
History
Date User Action Args
2022-04-11 14:56:20adminsetgithub: 44049
2006-09-28 23:15:05dbenbenncreate