List index question

questions? universal_used at hotmail.com
Wed Dec 7 15:39:48 EST 2005


I want to do list index function.
>>> y=['1','2','3','4']
>>> y
['1', '2', '3', '4']
>>> y.index['2']
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: unsubscriptable object

It works with y=[1,2,3,4].  Anyone has any hint, what's the reason
here?

thanks




More information about the Python-list mailing list