[Tutor] Tuple indexing

Steven D'Aprano steve at pearwood.info
Thu Mar 12 01:30:09 CET 2015


On Wed, Mar 11, 2015 at 02:08:18PM +0000, Ian D wrote:
[...]
> I then read that a Tuple has no attribute index on this site 
> http://www.diveintopython.net/native_data_types/tuples.html

That's pretty old, and written by an independent author. The official 
documentation for Python is here:

https://docs.python.org/2/index.html
https://docs.python.org/3/index.html

You should start there for any questions, not books written by some 
random person on the Internet. (Actually, in the case of Dive Into 
Python, no longer on the Internet. The original author, Mark Pilgrim, 
famously "disappeared" from the Internet a few years ago, deleting 
almost every trace of his life, removing email addresses, closing down 
accounts, etc.)

You can also use the help() function in the Python interactive 
interpreter: at the Python prompt, run:

help(tuple)

to see what methods are available.



-- 
Steve


More information about the Tutor mailing list