[Python Edinburgh] Comparing two Tuples

Mark Smith mark.smith at practicalpoetry.co.uk
Wed Oct 20 16:28:58 CEST 2010


Yeah, that was more or less my solution - I think it's pretty
intuitive - although I used slightly different syntax:

if set([1,2,3]) & set([3,4,5]): print 'yay!'

--Mark

On 20 October 2010 15:19, Dougal Matthews <dougal85 at gmail.com> wrote:
> On 20 October 2010 15:12, danjac354 at gmail.com <danjac354 at gmail.com> wrote:
>>
>> Off the top of my head:
>>
>> bool(set(A).intersection(B))
>
> That's what I'm using. Although you don't need the bool method call - maybe
> its more intuitive than I thought!
> Dougal
> _______________________________________________
> Edinburgh mailing list
> Edinburgh at python.org
> http://mail.python.org/mailman/listinfo/edinburgh
>
>



-- 
Mark Smith
Practical Poetry - Software development done the right way.


More information about the Edinburgh mailing list