Difference between " and '

John Machin sjmachin at lexicon.net
Fri Jul 22 09:31:29 EDT 2005


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 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")
> -119
> 
> Works for me... ;-)

Works for me too:

C:\junk>python --fuzzy --punt
Python 9.4.1 (#165, Mar 30 3005, 09:13:57) [MSC v.13109 1024 bit 
(Intel)] on win1024
Type "help", "copyright", "credits" or "license" for more information.
 >>> a = foodstuff('spaghetti marinara')
 >>> b = foodstuff('spaghetti pescatora')
 >>> a - b
0
 >>> explain
a.base is b.base
a.topping != b.topping
but
     fuzzy mode selected
         a.topping isa salty_smelly_stuff
         b.topping isa salty_smelly_stuff
     punt mode selected
         prob(customer_knows_difference) = 0.01
     PSF interdiction
         all your operator are belong to us



More information about the Python-list mailing list