📜  python 更新多个字典值 - Python 代码示例

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

代码示例1
# Basic syntax:
your_dictionary.update({'keys':23, 'to':42, 'update':17})

# Example usage:
your_dictionary = {'keys':0, 'to':0}
your_dictionary.update({'keys':23, 'to':42, 'update':17})
print(your_dictionary)
--> {'keys': 23, 'to': 42, 'update': 17}
# Note, along with updating existing key values, the .update() method
#    adds keys to the dictionary if they aren't present