Re: String Formatting with new .format()

2018-03-28 Thread Chris Angelico
On Thu, Mar 29, 2018 at 1:54 AM, Dan Stromberg wrote: > On Wed, Mar 28, 2018 at 7:30 AM, Ganesh Pal wrote: >>> >>> Or maybe they're not giving the same result. I'm a little confused here. >>> >> >> >> My Bad and Apologies , I should be fined for pasting wrong question. >> >> Actually I wanted t

Re: String Formatting with new .format()

2018-03-28 Thread Dan Stromberg
On Wed, Mar 28, 2018 at 7:30 AM, Ganesh Pal wrote: >> >> Or maybe they're not giving the same result. I'm a little confused here. >> > > > My Bad and Apologies , I should be fined for pasting wrong question. > > Actually I wanted to know if its ok to use just empty {} with .format() > or use {

Re: String Formatting with new .format()

2018-03-28 Thread Frank Millman
"Ganesh Pal" wrote in message news:CACT3xuUmOzR=5G9=zaf3fp2lytbgjv74vsyjfsvsifo77lf...@mail.gmail.com... Actually I wanted to know if its ok to use just empty {} with .format() or use {} with values i.e {0} {1} both will give the same results anyway The benefit of using empty {} is that yo

Re: String Formatting with new .format()

2018-03-28 Thread Ganesh Pal
> > Or maybe they're not giving the same result. I'm a little confused here. > My Bad and Apologies , I should be fined for pasting wrong question. Actually I wanted to know if its ok to use just empty {} with .format() or use {} with values i.e {0} {1} both will give the same results anyway

Re: String Formatting with new .format()

2018-03-27 Thread Michael Torrie
On 03/26/2018 09:37 AM, Ganesh Pal wrote: > Hi Team, > > Just a quick suggestion, on string formatting with .format() which of the > below is better , given both give the same result . No they don't. Look more closely at the output. attempts = 1 msg2 = "Hello" print "Retry attempt

Re: String Formatting with new .format()

2018-03-27 Thread Ganesh Pal
> > > Or maybe they're not giving the same result. I'm a little confused here. > > Thanks Chris, for the reply they appear to give the same result . -- https://mail.python.org/mailman/listinfo/python-list

Re: String Formatting with new .format()

2018-03-26 Thread W Yg
在 2018年3月26日星期一 UTC+8下午11:37:46,Ganesh Pal写道: > Hi Team, > > Just a quick suggestion, on string formatting with .format() which of the > below is better , given both give the same result . > > >>> attempts = 1 > >>> msg2 = "Hello" > >>> print "Retry attempt:{0} for error:{1}".format(attempts,msg2

Re: String Formatting with new .format()

2018-03-26 Thread Chris Angelico
On Tue, Mar 27, 2018 at 2:37 AM, Ganesh Pal wrote: > Hi Team, > > Just a quick suggestion, on string formatting with .format() which of the > below is better , given both give the same result . > attempts = 1 msg2 = "Hello" print "Retry attempt:{0} for error:{1}".format(attempts,msg

String Formatting with new .format()

2018-03-26 Thread Ganesh Pal
Hi Team, Just a quick suggestion, on string formatting with .format() which of the below is better , given both give the same result . >>> attempts = 1 >>> msg2 = "Hello" >>> print "Retry attempt:{0} for error:{1}".format(attempts,msg2) Retry attempt:1 for error:Hello OR >>> attempts = 1 >>> ms