列表函数
添加:append,extend,insert
删除 del list[index]
remove()
pop()
clear()
remove()
删除制定元素第一次出现的位置。
如果没有找到要删除的元素会报异常
hotpot_list=['海底捞','张亮','呷脯呷脯','热辣一号','宽板凳']
hotpot_list.append('张亮')
print(hotpot_list)
hotpot_list.remove('张亮')
print(hotpot_list)
pop()
弹栈:移除列表中的最后一个元素,返回值是删除的那个元素。
hotpot_list=['海底捞','张亮','呷脯呷脯','热辣一号','宽板凳']
hotpot_list.append('张亮')
print(hotpot_list)
result=hotpot_list.pop()
print(result)
print(hotpot_list)
队列:先进先出
栈:后进先出