from collections import OrderedDict

#d = OrderedDict(['a','b','c','d'])#ValueError: need more than 1 value to unpack
#d = OrderedDict(*['a','b','c','d'])#TypeError: expected at most 1 arguments, got 4
d = OrderedDict([('a', 4),('b',3),('c',2),('d',1)])
print(d)
for k,v in d.items(): print(k,v)

for i in range(len(d)): print(d.popitem())
print(d)
d = OrderedDict([('a', 4),('b',3),('c',2),('d',1)])#TypeError: expected at most 1 arguments, got 4
for i in range(len(d)): print(d.popitem(last=False))
print(d)

d = OrderedDict([('a', 4),('b',3),('c',2),('d',1)])#TypeError: expected at most 1 arguments, got 4
d.move_to_end('a')
print(d)
d.move_to_end('a', last=False)
print(d)

for key in reversed(d): print(key)

85493c3b1b8c270beffaac6d3108bbf649e7b186
<mask token>

<mask token>
print(d)
for k, v in d.items():
    print(k, v)
for i in range(len(d)):
    print(d.popitem())
print(d)
<mask token>
for i in range(len(d)):
    print(d.popitem(last=False))
print(d)
<mask token>
d.move_to_end('a')
print(d)
d.move_to_end('a', last=False)
print(d)
for key in reversed(d):
    print(key)

<mask token>
d = OrderedDict([('a', 4), ('b', 3), ('c', 2), ('d', 1)])
print(d)
for k, v in d.items():
    print(k, v)
for i in range(len(d)):
    print(d.popitem())
print(d)
d = OrderedDict([('a', 4), ('b', 3), ('c', 2), ('d', 1)])
for i in range(len(d)):
    print(d.popitem(last=False))
print(d)
d = OrderedDict([('a', 4), ('b', 3), ('c', 2), ('d', 1)])
d.move_to_end('a')
print(d)
d.move_to_end('a', last=False)
print(d)
for key in reversed(d):
    print(key)

from collections import OrderedDict
d = OrderedDict([('a', 4), ('b', 3), ('c', 2), ('d', 1)])
print(d)
for k, v in d.items():
    print(k, v)
for i in range(len(d)):
    print(d.popitem())
print(d)
d = OrderedDict([('a', 4), ('b', 3), ('c', 2), ('d', 1)])
for i in range(len(d)):
    print(d.popitem(last=False))
print(d)
d = OrderedDict([('a', 4), ('b', 3), ('c', 2), ('d', 1)])
d.move_to_end('a')
print(d)
d.move_to_end('a', last=False)
print(d)
for key in reversed(d):
    print(key)

from collections import OrderedDict

#d = OrderedDict(['a','b','c','d'])#ValueError: need more than 1 value to unpack
#d = OrderedDict(*['a','b','c','d'])#TypeError: expected at most 1 arguments, got 4
d = OrderedDict([('a', 4),('b',3),('c',2),('d',1)])
print(d)
for k,v in d.items(): print(k,v)

for i in range(len(d)): print(d.popitem())
print(d)
d = OrderedDict([('a', 4),('b',3),('c',2),('d',1)])#TypeError: expected at most 1 arguments, got 4
for i in range(len(d)): print(d.popitem(last=False))
print(d)

d = OrderedDict([('a', 4),('b',3),('c',2),('d',1)])#TypeError: expected at most 1 arguments, got 4
d.move_to_end('a')
print(d)
d.move_to_end('a', last=False)
print(d)

for key in reversed(d): print(key)
