summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/dict_popitem.py
blob: e37bcec19eeefa1b057a82a89c92a3f407006d2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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))