micropython: add micropython component
This commit is contained in:
26
components/language/micropython/tests/basics/list1.py
Normal file
26
components/language/micropython/tests/basics/list1.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# basic list functionality
|
||||
x = [1, 2, 3 * 4]
|
||||
print(x)
|
||||
x[0] = 4
|
||||
print(x)
|
||||
x[1] += -4
|
||||
print(x)
|
||||
x.append(5)
|
||||
print(x)
|
||||
f = x.append
|
||||
f(4)
|
||||
print(x)
|
||||
|
||||
x.extend([100, 200])
|
||||
print(x)
|
||||
x.extend(range(3))
|
||||
print(x)
|
||||
|
||||
x += [2, 1]
|
||||
print(x)
|
||||
|
||||
# unsupported type on RHS of add
|
||||
try:
|
||||
[] + None
|
||||
except TypeError:
|
||||
print('TypeError')
|
Reference in New Issue
Block a user