@ Introducing Python: Modern Computing in Simple Packages by Bill Lubanovic (No. 1593 / 12833)
You can use the update() function to copy the keys and values of one dictionary into another.
J'ai fait un échantillon en me référant au code dans le livre.
http://ideone.com/uMxSqe
equipment = { 'item1': 'double edged sword', 'item2': 'Korejanai Robo'}
print(equipment)
second = {'item2': 'Delta Flyer'}
equipment.update(second)
print(equipment)
résultat
{'item2': 'Korejanai Robo', 'item1': 'double edged sword'}
{'item2': 'Delta Flyer', 'item1': 'double edged sword'}
Recommended Posts