[Tutor] How to substitute an element of a list as apattern forre.compile()

Jacob S. keridee at jayco.net
Sat Jan 1 22:35:31 CET 2005



> Actually %s formatting is very flexible and forgiving, it outputs str(x)
whatever x is. For example:
>   >>> for x in ['string', 10, True, [1,2,3] ]:
>   ...   print '%s' %x
>   ...
> string
> 10
> True
> [1, 2, 3]
>
> Kent

That's cool! I didn't know that. I guess I'm crazy... : )
(We already knew that here.)

Jacob



More information about the Tutor mailing list