1.构造
student = ['xuzhang','dudu','mating']
2.取值
In [14]: student[0]
Out[14]: 'xuzhang'
In [15]: student[1]
Out[15]: 'dudu'
#从后往前,-1代表最后一个元素,以此类推
In [16]: student[-1]
Out[16]: 'mating'
3.添加与删除元素
In [18]: student.append('zhangsan')
In [19]: student
Out[19]: ['xuzhang', 'dudu', 'mating', 'zhangsan']
#在指定的位置插入值
In [21]: student.insert(1,'linjie')
In [22]: student
Out[22]: ['xuzhang', 'linjie', 'dudu', 'mating', 'zhangsan']
In [23]: student
Out[23]: ['xuzhang', 'linjie', 'dudu', 'mating', 'zhangsan']
In [24]: student.pop()
Out[24]: 'zhangsan'
In [25]: student
Out[25]: ['xuzhang', 'linjie', 'dudu', 'mating']
#指定位置删除元素
In [27]: student
Out[27]: ['xuzhang', 'linjie', 'dudu', 'mati
In [28]: student.pop(1)
Out[28]: 'linjie'
In [29]: student
Out[29]: ['xuzhang', 'dudu', 'mating']