[sf-lug] [PYCLASS] Still on exercise 2.1

Christian Einfeldt einfeldt at gmail.com
Sun Oct 5 22:30:57 PDT 2008


hi,

On Sun, Oct 5, 2008 at 9:54 PM, Charles-Henri Gros <chgros at coverity.com>wrote:
thx for this:


>
> %d means: there will be a decimal value to print
>
> %02d means: there will be a decimal value to print; print 2 digits (this
> is all a bit too complicated to explain in detail in an e-mail)
>
> The next '%' announces the arguments, i.e. the values referred to above
> ( a, b ) [where a is (secs/MIN) and b is (secs%MIN) specifies the values
>
> The colon is just printed verbatim.
>
> The (a,b) structure is called a "tuple", it represents multiple values.
>
> For instance to print 3 integers you could use
>
> print "integer 1:%d; integer 2:%d; integer 3:%d" % (11, 12, 13)


It almost looks as if this is a definitional statement or an assignment
statement in which you are assigning the values of 11, 12, and 13 to integer
1, integer 2, and integer 3.

Coincidentally, I am wondering why you left a space after "integer"  I am
guessing that is because integer is a keyword in Python?

BTW, I would like to thank Asheesh for choosing Python as his language to
teach us.  The many references to Monty Python's gags makes me laugh out
loud, which make learning Python much easier.  For example, the lumberjack
example in functions just had me rolling on the floor, as that lumberjack
skit was one of my favs.

c u
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxmafia.com/pipermail/sf-lug/attachments/20081005/36acb40e/attachment.html>


More information about the sf-lug mailing list