Re: [Tutor] Defining a "format string"

2011-06-26 Thread Lisi
On Sunday 26 June 2011 17:15:14 Alan Gauld wrote: > "Lisi" wrote > Umm, nearly... > The format string contains format specifiers. They are not variables. > The specifiers define the type of data to be inserted into the string > as well as how the data will be formatted - hence the name. > > So you

Re: [Tutor] Defining a "format string"

2011-06-26 Thread Alan Gauld
"Lisi" wrote So, if I have now understood correctly, a format string is a string containing at least one variable, and the variable(s) is/are preceded by the % symbol. Yes??? Umm, nearly... The format string contains format specifiers. They are not variables. The specifiers define the type

Re: [Tutor] Defining a "format string"

2011-06-26 Thread Noah Hall
On Sun, Jun 26, 2011 at 2:42 PM, Lisi wrote: > Thanks, Noah and Steven.  :-) > > On Sunday 26 June 2011 12:24:12 Steven D'Aprano wrote: >> Lisi wrote: >> > 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_a

Re: [Tutor] Defining a "format string"

2011-06-26 Thread Lisi
Thanks, Noah and Steven. :-) On Sunday 26 June 2011 12:24:12 Steven D'Aprano wrote: > Lisi wrote: > > 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

Re: [Tutor] Defining a "format string"

2011-06-26 Thread Steven D'Aprano
Lisi wrote: 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 str

Re: [Tutor] Defining a "format string"

2011-06-26 Thread Noah Hall
On Sun, Jun 26, 2011 at 12:05 PM, Lisi wrote: > 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 +

[Tutor] Defining a "format string"

2011-06-26 Thread Lisi
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, th