circuitpython/tests/basics/dict_popitem.py

12 lines
192 B
Python
Raw Normal View History

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