📜  在 dict python 代码示例中搜索

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

代码示例1
dictionary = { "key1" : 1, "name" : "Jordan", "age" : 21 }
for key in dictionary.keys():
    print("the key is {} and the value is {}".format(key, dictionary[key]))
    # or print("the key is",key,"and the value is",dictionary[key])
# OUTPOUT
# the key is key1 and the value is 1
# the key is name and the value is Jordan
# the key is age and the value is 21