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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4