Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

ordereddict move to end

>>> d = OrderedDict.fromkeys('abcde')
>>> d.move_to_end('b')
>>> ''.join(d.keys())
'acdeb'
>>> d.move_to_end('b', last=False)
>>> ''.join(d.keys())
'bacde'
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #ordereddict #move
ADD COMMENT
Topic
Name
4+1 =