[Tutor] The magic parentheses

Kent Johnson kent37 at tds.net
Sun Jan 24 21:28:44 CET 2010


On Sun, Jan 24, 2010 at 12:08 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
>
> "Hugo Arts" <hugo.yoshi at gmail.com> wrote
>>>>>
>>>>> print "this is {0}".format("formatted")
>>
>> this is formatted
>
> Caveat:
> this style only works in Python 3.0 upwards  (or maybe in 2.6/2.7?)

It's in 2.6
http://docs.python.org/library/stdtypes.html#str.format

Kent


More information about the Tutor mailing list