Created
November 21, 2019 04:31
-
-
Save y56/9b9250e5c96dd80dad2dfb0c18be9ba3 to your computer and use it in GitHub Desktop.
to remove the last entry from orderedDict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import OrderedDict | |
myOrderedDict = OrderedDict() | |
myOrderedDict['a'] = 1 | |
myOrderedDict['b'] = 2 | |
myOrderedDict.popitem(last = False) # Setting last to False signals you wanted to remove the first. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment