Steven D'Aprano <steve <at> pearwood.info> writes: > > That's hardly unusual in Python. > > >>> alist = [0, 1, 2, 3, 4] > >>> 3.0 in alist > True > >>> alist[3.0] > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > TypeError: list indices must be integers
Your example is wrong: >>> alist = [0, 1, 2, 3, 4] >>> alist.index(3.0) 3 >>> alist[alist.index(3.0)] 3 Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com