On Sat, 20 Oct 2007 12:43:31 +0000, Steve Lamb wrote:

> The quick answer is that tuples can be indexes into directories
> while lists cannot.


A note on terminology: the things inside curly brackets {} are called 
dictionaries, or dicts, not directories. And the things you use to store 
data in dictionaries are called keys, not indexes:

# Lists have indexes:
L = ['x', 'y', 'z']
L[0] # returns the item in position 0

# Dicts have keys:
D = {'a': 'x', 2: 'y', 7.8: 'z'}
D['a'] # returns the item with key 'a'



-- 
Steven.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to