Re: Hat difference between "" and '' in string definition

2017-09-09 Thread Steve D'Aprano
On Sun, 10 Sep 2017 05:47 am, Stefan Ram wrote: > Andrej Viktorovich writes: >>What is difference between string definitions: >>s="aaa" >>and >>s='bbb' > > These two assignment statements differ in their > last five characters. > > Their difference can be calculated thus: > > |>>> int.fr

Re: Hat difference between "" and '' in string definition

2017-09-09 Thread MRAB
On 2017-09-09 07:43, Andrej Viktorovich wrote: Hello, What is difference between string definitions: s="aaa" and s='bbb' There's no difference. -- https://mail.python.org/mailman/listinfo/python-list

Re: Hat difference between "" and '' in string definition

2017-09-09 Thread Peter Otten
Andrej Viktorovich wrote: > What is difference between string definitions: > s="aaa" > and > s='bbb' There's no difference. It helps you avoid explicit escapes, i. e. >>> "What's up?" "What's up?" is a tad more readable than >>> 'What\'s up' "What's up" Likewise, multiline strings are easier

Hat difference between "" and '' in string definition

2017-09-08 Thread Andrej Viktorovich
Hello, What is difference between string definitions: s="aaa" and s='bbb' -- https://mail.python.org/mailman/listinfo/python-list

Re: Difference between " and '

2005-07-23 Thread Steven D'Aprano
On Fri, 22 Jul 2005 08:38:28 -0400, Peter Hansen wrote: > Steven D'Aprano wrote: >> It may shock some people to learn that difference in the sense of >> mathematical subtraction is not the only meaning of the word, but there >> it is. One wouldn't, I hope, misunderstand "What is the difference

Re: Difference between " and '

2005-07-22 Thread Brian van den Broek
Andrew Dalke said unto the world upon 2005-07-22 13:30: > François Pinard wrote: > >>There is no strong reason to use one and avoid the other. Yet, while >>representing strings, Python itself has a _preference_ for single >>quotes. > > > I use "double quoted strings" in almost all cases becaus

Re: Difference between " and '

2005-07-22 Thread Andrew Dalke
François Pinard wrote: > There is no strong reason to use one and avoid the other. Yet, while > representing strings, Python itself has a _preference_ for single > quotes. I use "double quoted strings" in almost all cases because I think it's easier to see than 'single quoted quotes'.

Re: Difference between " and '

2005-07-22 Thread François Pinard
[Terry Hancock] > On Friday 22 July 2005 08:09 am, François Pinard wrote: > > > [Robert Kern] > > > > > One habit that seems to crop up, though, is that I will use '' for > > > internal strings and "" for strings that will eventually get seen > > > by the user. Don't ask me why. > > One sure thi

Re: Difference between " and '

2005-07-22 Thread Terry Hancock
On Friday 22 July 2005 08:09 am, François Pinard wrote: > [Robert Kern] > > One habit that seems to crop up, though, is that I will use '' for > > internal strings and "" for strings that will eventually get seen by > > the user. Don't ask me why. > > One sure thing is that it would help, later,

Re: Difference between " and '

2005-07-22 Thread John Machin
Peter Hansen wrote: > Steven D'Aprano wrote: > >> It may shock some people to learn that difference in the sense of >> mathematical subtraction is not the only meaning of the word, but >> there it is. One wouldn't, I hope, misunderstand "What is the >> difference between spaghetti marinara and

Re: Difference between " and '

2005-07-22 Thread François Pinard
[Robert Kern] > One habit that seems to crop up, though, is that I will use '' for > internal strings and "" for strings that will eventually get seen by > the user. Don't ask me why. One sure thing is that it would help, later, if you ever want to internationalise a Python program. Not that it

Re: Difference between " and '

2005-07-22 Thread François Pinard
[EMAIL PROTECTED] > Can someone tell me the difference between single quote and double > quote? There is no strong reason to use one and avoid the other. Yet, while representing strings, Python itself has a _preference_ for single quotes. Programmers can put this duality to good use, by adoptin

Re: Difference between " and '

2005-07-22 Thread Peter Hansen
Steven D'Aprano wrote: > It may shock some people to learn that difference in the sense of > mathematical subtraction is not the only meaning of the word, but there > it is. One wouldn't, I hope, misunderstand "What is the difference > between spaghetti marinara and spaghetti pescatora?" and att

Re: Difference between " and '

2005-07-22 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > Can someone tell me the difference between single quote and double > quote? One has double the fun. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Forgive your enemies, but never f

Re: Difference between " and '

2005-07-22 Thread Grant Edwards
On 2005-07-22, Steven D'Aprano <[EMAIL PROTECTED]> wrote: Can someone tell me the difference between single quote and double quote? >>> >>> >>> ord("'") - ord('"') >>> 5 >> >> Very zen. > > But unfortunately incorrect, since the original poster > didn't ask for the difference between

Re: Difference between " and '

2005-07-22 Thread John Machin
[EMAIL PROTECTED] wrote: > Hi, > > Can someone tell me the difference between single quote and double > quote? >>> ord("'") - ord('"') 5 or ask a meaningful question ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between " and '

2005-07-22 Thread Michael Hoffman
Steven D'Aprano wrote: > Michael Hoffman wrote: > >> John Machin wrote: >> >>> [EMAIL PROTECTED] wrote: >>> Can someone tell me the difference between single quote and double quote? >>> >>> >>> ord("'") - ord('"') >>> 5 >> >> Very zen. > > But unfortunately incorrect, since the origina

Re: Difference between " and '

2005-07-21 Thread Benji York
Steven D'Aprano wrote: > Michael Hoffman wrote: >>John Machin wrote: >>>[EMAIL PROTECTED] wrote: Can someone tell me the difference between single quote and double quote? >>> >>> ord("'") - ord('"') >>>5 >>Very zen. > But unfortunately incorrect, since the original poster > didn't ask f

Re: Difference between " and '

2005-07-21 Thread Robert Kern
Steven D'Aprano wrote: > Michael Hoffman wrote: > >>John Machin wrote: >> >>>[EMAIL PROTECTED] wrote: >>> Can someone tell me the difference between single quote and double quote? >>> >>> >>> ord("'") - ord('"') >>>5 >> >>Very zen. > > But unfortunately incorrect, since the original poste

Re: Difference between " and '

2005-07-21 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: > Hi, > > Can someone tell me the difference between single quote and double > quote? There is none. Except that in a double quoted string, single quotes don't have to be escaped and vice versa, sometimes one of the two forms saves you some backslashes: "That's my house"

Re: Difference between " and '

2005-07-21 Thread Steven D'Aprano
Michael Hoffman wrote: > John Machin wrote: > >> [EMAIL PROTECTED] wrote: >> >>> Can someone tell me the difference between single quote and double >>> quote? >> >> >>> ord("'") - ord('"') >> 5 > > Very zen. But unfortunately incorrect, since the original poster didn't ask for the difference

Re: Difference between " and '

2005-07-21 Thread Robert Kern
[EMAIL PROTECTED] wrote: > The only difference is when you want to include " or ' inside the string. If > you want to include the "like" quote, then escape it ("\"", '\''). If you > include the "unlike" quote, no escape is needed ("'" or '"'). > > I think that people new to programming will use

Re: Difference between " and '

2005-07-21 Thread jepler
The only difference is when you want to include " or ' inside the string. If you want to include the "like" quote, then escape it ("\"", '\''). If you include the "unlike" quote, no escape is needed ("'" or '"'). I think that people new to programming will use '' if it is unshifted on their keyb

Difference between " and '

2005-07-21 Thread [EMAIL PROTECTED]
Hi, Can someone tell me the difference between single quote and double quote? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between " and '

2005-07-21 Thread Michael Hoffman
John Machin wrote: > [EMAIL PROTECTED] wrote: > >> Can someone tell me the difference between single quote and double >> quote? > > >>> ord("'") - ord('"') > 5 Very zen. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between " and '

2005-07-21 Thread muldoon
[EMAIL PROTECTED] wrote: > Hi, > > Can someone tell me the difference between single quote and double > quote? > > Thanks And please settle the dispute between "xxx". And "xxx". There was a fellow at Oxford who decided these things but I hear he went mad. -- http://mail.python.org/mailma