Difference between " and '

Steven D'Aprano steve at REMOVEMEcyber.com.au
Thu Jul 21 21:51:02 EDT 2005


Michael Hoffman wrote:
> John Machin wrote:
> 
>> b83503104 at yahoo.com 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 the ordinal 
values of the single quote and double quote characters, 
but for the difference between the characters themselves.

The question was in plain English, and in my opinion, 
perfectly understandable, especially since some common 
programming languages do have significant differences 
between single-quoted strings and double-quoted strings.

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 
attempt to subtract one from the other, since 
subtraction is not defined for foodstuffs.



-- 
Steven.




More information about the Python-list mailing list