On 14 June 2013 08:23, Dotan Cohen <dotanco...@gmail.com> wrote:

> What are these two string-formatting styles called?
> '%.3f' % x
> '{0:.3f}'.format(x)
>

The first one is a string Expression, using % as the overloaded operator
The second one is a string method, with .format() as the method for a
string object

put   python string expression   or   python string method   in that great
teaching tool, Google.

I know this since I'm reading that part of my python book right now and can
actually remember it. Although I fell asleep on the third page of
explanations of the more convoluted ways to use {}, which can get
convoluted indeed ;')

-- 
Jim
A noun is just a verb with the hiccups
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to