summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/list1.py
blob: 0697c9e3a78e70b0eb16e11a809e10c4d2f5304c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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')