summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/dict_pop.py
blob: 602560ce9d402ada5f7044699cab547e4a3de9f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
d = {1: 2, 3: 4}
print(d.pop(3), d)
print(d)
print(d.pop(1, 42), d)
print(d.pop(1, 42), d)
print(d.pop(1, None), d)
try:
    print(d.pop(1), "!!!",)
except KeyError:
    print("Raised KeyError")
else:
    print("Did not rise KeyError!")