返回并删除字典中的最后一对键和值。
dict.popitem()复制
dict.popitem()
def test(): arr={"a":"A","b":"B","c":"C"} ret=arr.popitem() print(ret) 输出:("c", "C")复制
def test():
arr={"a":"A","b":"B","c":"C"}
ret=arr.popitem()
print(ret)
输出:("c", "C")