Some python syntax that I'm not getting

Chris cwitts at gmail.com
Fri Dec 7 07:36:52 EST 2007


On Dec 7, 2:31 pm, waltbrad <waltb... at hotmail.com> wrote:
>
> I understand how D['say'] gets you 5,  But I still don't understand
> the line after the 5.
>
> How is the character 's' some special code?  And I don't get what is
> going on with the % character.  I'm used to it's use in c-style
> formatting, but this just seems so bizarre.  I can tell that the key
> is being replaced by it's value in the string, but I don't know how
> that is being done.
>
> TIA

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

The '%' invokes the formatter, the 's' specifies string type.



More information about the Python-list mailing list