Python辞書update
items

update辞書

pop

別のディクショナリまたはキーワード引数で値を更新します。

構文

dict.update(other)

使用例

下記の値を入力するとサンプルに即時反映されます。

person
print
person = {"name": "Alice"}
person.update({"age": 30, "city": "Seoul"})
print(person)
# {'name': 'Alice', 'age': 30, 'city': 'Seoul'}