klim@moose:~> python Python 2.5.2 (r252:60911, Mar 1 2008, 13:52:45) [GCC 4.2.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def innerif(a, b, l): ... if a in l : ... if b in l : ... print a, b, " both in ", l ... else: ... print a, " but not ", b, " in ", l ... >>> def outerif(a, b, l): ... if a in l : ... if b in l : ... print a, b, " both in ", l ... else: ... print a, " not in ", l ... >>> >>> innerif(3, 5, [1,2,3,4,5]) 3 5 both in [1, 2, 3, 4, 5] >>> innerif(3, 6, [1,2,3,4,5]) 3 but not 6 in [1, 2, 3, 4, 5] >>> innerif(77, 6, [1,2,3,4,5]) >>> >>> >>> outerif(3, 5, [1,2,3,4,5]) 3 5 both in [1, 2, 3, 4, 5] >>> outerif(3, 6, [1,2,3,4,5]) >>> outerif(77, 6, [1,2,3,4,5]) 77 not in [1, 2, 3, 4, 5] >>> klim@moose:~>