Marc 'BlackJack' Rintsch wrote: >>>>> def inplusplus(value,listObj): >> ... for i in listObj: >> ... if i is value: >> ... return value >> ... return False >> ... > > def my_in(value, sequence): > if value in sequence: > return value > else: > return False
however, >>> a = [1.0, 2, 3] >>> my_in(1, a) 1 >>> my_in(2.0, a) 2.0 >>> my_in(3L, a) 3L so it all depends on what the OP means by "is in". </F> -- http://mail.python.org/mailman/listinfo/python-list