# del 根据下标删除 # pop 删除最后一个元素 # remove 根据元素的值进行删除 # a_list = [1,2,3,4,5,6] # print(a_list) # del a_list[3] # del list[下标] 根据下标删除 # print(a_list) # C:\Python\Python37\python.exe F:/program/python/lianxi/035_列表高级_删除.py # [1, 2, 3, 4, 5, 6] # [1, 2, 3, 5, 6] # # Process finished with exit code 0 # # a_list = [1,2,3,4,5,6] # print(a_list) # a_list.pop() # pop 删除最后一个元素 # print(a_list) # C:\Python\Python37\python.exe F:/program/python/lianxi/035_列表高级_删除.py # [1, 2, 3, 4, 5, 6] # [1, 2, 3, 4, 5] # # Process finished with exit code 0 # a_list = [1,2,3,4,5,6] # print(a_list) # a_list.remove(4) # remove 根据元素的值进行删除 remove(元素的值) # print(a_list) # C:\Python\Python37\python.exe F:/program/python/lianxi/035_列表高级_删除.py # [1, 2, 3, 4, 5, 6] # [1, 2, 3, 5, 6] # # Process finished with exit code 0