With the aim of getting consistency, and removing the need to learn an additional term, replace uses of uPy/uPython with MPy/MicroPython. Rule of thumb was to use "MPy" abbreviation where "CPy" is used nearby, but the full word MicroPython otherwise. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
18 lines
355 B
Python
18 lines
355 B
Python
# list poppin'
|
|
a = [1, 2, 3]
|
|
print(a.pop())
|
|
print(a.pop())
|
|
print(a.pop())
|
|
try:
|
|
print(a.pop())
|
|
except IndexError:
|
|
print("IndexError raised")
|
|
else:
|
|
raise AssertionError("No IndexError raised")
|
|
|
|
# popping such that list storage shrinks (tests implementation detail of MicroPython)
|
|
l = list(range(20))
|
|
for i in range(len(l)):
|
|
l.pop()
|
|
print(l)
|