建立数组

x=list(range(11))

x
Out[16]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

打乱数组

random.shuffle(x)

x
Out[18]: [0, 8, 9, 4, 7, 2, 5, 3, 1, 6, 10]

排序

x.sort()

x
Out[20]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
max(x)
Out[21]: 10

min(x)
Out[22]: 0
sum(x)
Out[24]: 55
len(x)
Out[26]: 11

append

x1=[1,2,3]

x1.append(4)

x1
Out[14]: [1, 2, 3, 4]