You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
263 B
24 lines
263 B
# 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)
|
|
|
|
print(x[1:])
|
|
print(x[:-1])
|
|
print(x[2:3])
|
|
|