[Tutor] Dictionary Elements

James.Rocks@equant.com James.Rocks@equant.com
Wed, 16 Oct 2002 11:07:36 +0100


Hi,

If I have a dictionary of 6 tuples e.g.

{'LONA18': 'GREEN', 'LONTSATL19': 'GREEN', 'LONTSGLA01': 'GREEN', 'LONA15':
'GREEN', 'LONA14': 'GREEN', 'LONA17': 'GREEN'}

... and I want to read BOTH key and value by numerical reference e.g. print
dictionary[1] (I know this is wrong) prints:

'LONA18'

How do I do it?

James

James C. Rocks
Equant
Archway House
Canary Wharf
London E14 9SZ