What exactly do you mean by putting .format into a variable? You mean like this:

"{name} is very {adj} {gender}".format(name="sandy",adj="diligent",gender="female")

Sat, 31 Dec 2011 20:19:34 +0200 tarihinde davidfx <dgeorge2...@gmail.com> şöyle yazmış:

Hello everyone,
I just have a quick question about .format and %r %s %d.

Should we always be using .format() for formatting strings or %?

Example a = 'apples'
              print "I love {0}.".format(a)

If I wanted to put .format into a variable, how would I do that.

Thanks for your information in advance.

David


--
Opera'nın e-posta istemcisi ile gönderildi: http://www.opera.com/mail
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to