list:

del list(key) 删除指定下标元素

pop()删除最后一个数, list.pop()

remove()删除指定的一个值,list.remove(value)

clear()清空列表,list.clear()

 

dict:

pop()删除给定健对应的值,如:dict.pop(index)

clear()清空字典内容,dict.clear()

popitem()随机删除字典内容, dict.popitem()

相关文章:

  • 2021-12-26
  • 2021-04-29
  • 2022-12-23
  • 2021-08-20
  • 2021-09-04
  • 2021-07-29
  • 2022-12-23
  • 2021-12-26
猜你喜欢
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
  • 2021-08-15
相关资源
相似解决方案