Re: print & string formatting

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 10:24:55 UTC+5:30, Cameron Simpson wrote: > On 21Jul2018 21:33, Sharan Basappa wrote: > >I get a lot confused while using print functions in Python. > > > >For example, I get the same results for the following code: > > > >str = "one two three" > > Pleasetry not to name v

Re: print & string formatting

2018-07-22 Thread Thomas Jollans
On 22/07/18 06:54, Cameron Simpson wrote: > On 21Jul2018 21:33, Sharan Basappa wrote: >> I get a lot confused while using print functions in Python. >> >> For example, I get the same results for the following code: >> >> str = "one two three" > > Pleasetry not to name variables after builtin clas

Re: print & string formatting

2018-07-21 Thread Cameron Simpson
On 21Jul2018 21:33, Sharan Basappa wrote: I get a lot confused while using print functions in Python. For example, I get the same results for the following code: str = "one two three" Pleasetry not to name variables after builtin classes ("str" is the name of Python's string class). prin

Re: print & string formatting

2018-07-21 Thread Chris Angelico
On Sun, Jul 22, 2018 at 2:53 PM, Abdur-Rahmaan Janhangeer wrote: > *Folks,I get a lot confused while using print functions in Python.For > example, I get the same results for the following code:str = "one two > three"print strprint "%s" %(str)So, what is the need to use the second > method which I

Re: print & string formatting

2018-07-21 Thread Abdur-Rahmaan Janhangeer
*Folks,I get a lot confused while using print functions in Python.For example, I get the same results for the following code:str = "one two three"print strprint "%s" %(str)So, what is the need to use the second method which I see being used in many programs I am referring to* well 1) that is more

print & string formatting

2018-07-21 Thread Sharan Basappa
Folks, I get a lot confused while using print functions in Python. For example, I get the same results for the following code: str = "one two three" print str print "%s" %(str) So, what is the need to use the second method which I see being used in many programs I am referring to -- https:/