circuitpython/tests/basics/dict_popitem.py
Diego Elio Pettenò dd5d7c86d2 Fix up end of file and trailing whitespace.
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-03 10:56:35 +01:00

16 lines
254 B
Python

els = []
d = {1:2,3:4}
a = d.popitem()
print(len(d))
els.append(a)
a = d.popitem()
print(len(d))
els.append(a)
try:
print(d.popitem(), "!!!",)
except KeyError:
print("Raised KeyError")
else:
print("Did not raise KeyError")
print(sorted(els))