circuitpython/tests/basics/dict_popitem.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
254 B
Python
Raw Normal View History

els = []
d = {1:2,3:4}
a = d.popitem()
print(len(d))
els.append(a)
a = d.popitem()
print(len(d))
els.append(a)
2014-01-06 15:08:52 -05:00
try:
print(d.popitem(), "!!!",)
except KeyError:
print("Raised KeyError")
else:
print("Did not raise KeyError")
print(sorted(els))