() vs []

Xavier Ho contact at xavierho.com
Thu Oct 15 04:27:53 EDT 2009


On Thu, Oct 15, 2009 at 3:21 AM, Nanjundi <nanjundi at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091015/8957f53f/attachment-0001.html>


More information about the Python-list mailing list