What you mean to do is y.index('2'), rather than y.index['2']. Call the index method of the list, rather than try to use index as if it was itself a list.
-- http://mail.python.org/mailman/listinfo/python-list
What you mean to do is y.index('2'), rather than y.index['2']. Call the index method of the list, rather than try to use index as if it was itself a list.
-- http://mail.python.org/mailman/listinfo/python-list