📜  如果在字典中键入 python 代码示例

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

代码示例6
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")