📜  有序字典 pop vs del - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:31.026000             🧑  作者: Mango

代码示例1
pop returns the value of deleted key.
Basically, d.pop(key) evaluates as x = d[key]; del d[key]; return x.

Use pop when you need to know the value of deleted key
Use del otherwise