[Tutor] Defining a "format string"

Lisi lisi.reisz at gmail.com
Sun Jun 26 13:05:01 CEST 2011


In the following excerpt from a program in the book I am following:

   print "If I add %d, %d, and %d I get %d." % ( 
      my_age, my_height, my_weight, my_age + my_height + my_weight)

is 

% ( 
      my_age, my_height, my_weight, my_age + my_height + my_weight)

the/a format string?

If not, then I still haven't "got" it, and I would be very grateful if someone 
could define "format string" for me - preferably in words of one syllable, 
because I seem to be being a bit thick about this. :-(

Lisi



More information about the Tutor mailing list