Update p07_ordered_dict.py
Modify wrong retract code
This commit is contained in:
@@ -7,13 +7,13 @@ Desc :
|
|||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
def ordered_dict():
|
|
||||||
d = OrderedDict()
|
d = OrderedDict()
|
||||||
d['foo'] = 1
|
d['foo'] = 1
|
||||||
d['bar'] = 2
|
d['bar'] = 2
|
||||||
d['spam'] = 3
|
d['spam'] = 3
|
||||||
d['grok'] = 4
|
d['grok'] = 4
|
||||||
# Outputs "foo 1", "bar 2", "spam 3", "grok 4"
|
# Outputs "foo 1", "bar 2", "spam 3", "grok 4"
|
||||||
for key in d:
|
for key in d:
|
||||||
print(key, d[key])
|
print(key, d[key])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user