Jump to content

Associative array/Merging: Difference between revisions

→‎{{header|Python}}: oops it should not mutate
(→‎{{header|Python}}: added alternative)
(→‎{{header|Python}}: oops it should not mutate)
Line 285:
update = {"price":15.25, "color":"red", "year":1974}
 
result = dict(base)
baseresult.update(update)
 
print(baseresult)</lang>
{{output}}
<pre>{'name': 'Rocket Skates', 'price': 15.25, 'color': 'red', 'year': 1974}</pre>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.