dictionaries...

Ron Forrester (rjf@aurora.pcg.com)
Mon, 18 Jul 1994 02:39:46 -0700

Given this dictionary:

months = { 'jan':1,
'feb':2,
'mar':3,
'apr':4,
'may':5,
'jun':6,
'jul':7,
'aug':8,
'sep':9,
'oct':10,
'nov':11,
'dec':12
}

What is the easy way to enumerate the keys in the order they are
declared above?

Right now, I can print them in some 'order', but its not deterministic
(because of the hashing, right?) using this:

def printMonths():
for month in months.keys():
print `month`,

Thanks for any insight...
rjf

-- 
| "I don't like being bluffed -- makes me doubt     |    rjf@aurora.pcg.com |
| my perception of reality..."                      |            71722,3175 |
|                      Chris in the morning on KBHR |                       |
+---------------------------------------------------+-----------------------+