Difference between " and '

Peter Hansen peter at engcorp.com
Fri Jul 22 14:38:28 CEST 2005

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

 >>> sum(ord(c) for c in 'spaghetti marinara') - sum(ord(c) for c in 
"spaghetti pescatora")

Works for me... ;-)

More information about the Python-list mailing list