micropython: add micropython component
This commit is contained in:
12
components/language/micropython/tests/basics/dict_pop.py
Normal file
12
components/language/micropython/tests/basics/dict_pop.py
Normal file
@@ -0,0 +1,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 raise KeyError!")
|
Reference in New Issue
Block a user