Tuple question

Gandalf gandalf at geochemsource.com
Thu Sep 2 13:13:26 EDT 2004


> users = ['admin', 'user1', 'user2']
> address = ('www.python.org', 80)
>
> index and count only make sense when the collection is homogeneous.  
> Therefore they are not defined for tuple. 

Why?

address = ['www.python.org',80]

A list can hold any kind of objects. I think that the 'index' method for 
tuples would be a good idea.





More information about the Python-list mailing list