On 29/03/2011 20:41, Prasad, Ramit wrote:
Is there a difference (or preference) between using the following?
"%s %d" % (var,num)
VERSUS
"{0} {1}".format(var,num)


Ramit

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


From Python 2.7.1 docs at http://docs.python.org/tutorial/inputoutput.html "Since str.format() is quite new, a lot of Python code still uses the % operator. However, because this old style of formatting will eventually be removed from the language, str.format() should generally be used.".

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to