On Thu, Oct 15, 2009 at 1:27 AM, Xavier Ho <cont...@xavierho.com> wrote: > On Thu, Oct 15, 2009 at 3:21 AM, Nanjundi <nanju...@gmail.com> wrote: >> 3 You can’t find elements in a tuple. Tuples have no index method. > > I don't know what language you're using there, but my Python tuples have > indexes. > >>>> a = (1, 2, 3) >>>> a > (1, 2, 3) >>>> a[1] > 2
Nanjundi meant "index method" as in "a method .index()" (i.e. a method named "index") which searches through the container for the given item and returns the index of the first instance of said item, like list.index() does. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list