[Tutor] %(value1, value2) what does this returns

Michiel Overtoom motoom at xs4all.nl
Tue Jul 22 20:48:47 CEST 2008


Vishwajeet wrote...

> I want to know in this % (symbol, stat) returns

In itself it returns nothing.  The '%' is used as the 'string interpolation
operator' here.

http://docs.python.org/lib/typesseq-strings.html

>>> print "%d kilos of %s for %f euro" % (2,"mangos",3.75)
2 kilos of mangos for 3.750000 euro

Greetings,

-- 
"The ability of the OSS process to collect and harness
the collective IQ of thousands of individuals across
the Internet is simply amazing." - Vinod Vallopillil
http://www.catb.org/~esr/halloween/halloween4.html



More information about the Tutor mailing list