代码如下: 

languages = ['c','c++','shell','java','vb']
print("original element\n",languages)
print("first element is",languages[0])
print("last element is",languages[-1])
print("\n")
##在末尾添加
languages.append("net")
print("append 'net'\n",languages)
##在指定位置添加
languages.insert(1,'python')
print("insert 'python'\n",languages)
##修改指定位置的元素
languages[3] = 'tcl'
print("change 'tcl'\n",languages)
##删除末尾的元素
languages.pop()
print("delete last element\n",languages)
##删除指定位置的元素
languages.pop(4)
print("delete element 4\n",languages)

结果:

=================== RESTART: C:/Users/公有制/Desktop/test1.py ===================
original element
['c', 'c++', 'shell', 'java', 'vb']
first element is c
last element is vb


append 'net'
['c', 'c++', 'shell', 'java', 'vb', 'net']
insert 'python'
['c', 'python', 'c++', 'shell', 'java', 'vb', 'net']
change 'tcl'
['c', 'python', 'c++', 'tcl', 'java', 'vb', 'net']
delete last element
['c', 'python', 'c++', 'tcl', 'java', 'vb']
delete element 4
['c', 'python', 'c++', 'tcl', 'vb']
>>>