Robert L
unread,May 30, 2011, 7:39:43 PM5/30/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Building Skills Books
Python version: 3.1.2
Tk version: 8.5
IDLE version: 3.1.2
Executed the code below
>>> ================================ RESTART ================================
>>> def to2( a ):
a = 2
return 0
>>> x = 27
>>> z = to2( x )
>>> print ("x=%d, z=%d" % ( x, z ))
x=27, z=0
>>> print("x=", x, ", z=", z)
x= 27 , z= 0
The only thing that I can't easily/quickly duplicate is the use of the
blank spaces.
Q: Besides the use of spaces in the output, what is lost if don't use
the %d string formatting?