Making different things equal

wes weston wweston at att.net
Sun Aug 22 23:53:15 EDT 2004


M. Clift wrote:
> Hi Wes,
> 
> Thanks for looking at this! I appreciate your effort.
> 
> The system works very well, but I want it to see Bob as being the same thing
> as Mary. So for example it won't give [Bob, whoever, Mary] as that would be
> the same as [Mary, whoever, Mary] or [Bob, whoever, Bob].
> 
> M
> 
> 

M,

 >>> list = ['Bob', 'whoever', 'Mary']
 >>> synonyms = ['Bob', 'Mary']
 >>> if synonyms[0] in list and synonyms[1] in list:
...     print "synonyms"
...
synonyms
 >>>

 >>> list.remove(synonyms[1])
 >>> list
['Bob', 'whoever']
 >>>

wes




More information about the Python-list mailing list