Robin Haswell wrote:
> Hey guys
>
> I was wondering if you could give me a hand with something. If I have two
> tuples that define a range, eg: (10, 20), (15, 30), I need to determine
> whether the ranges overlap each other.

def overlap(a,b):
    return a[0] <= b[0] <= a[1] or b[0] <= a[0] <= b[1]

-- Paul

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to