📌  相关文章
📜  如何检查python字典中是否存在键 - Python代码示例

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

代码示例1
dict = { "How":1,"you":2,"like":3,"this":4}
key = "this"
if key in dict.keys():
    print("present")
    print("value =",dict[key])
else:
    print("Not present")