filmov
tv
Python Merge dictionary | merge dictionary using operator |= python code | python tutorial #shorts

Показать описание
d = {'a':10,'b':30}
merge the dictionary x inside dictionry d
x = {'i':11,'j':12}
output-: {'a':10,'b':30,'i':11,'j':12}
code:
d = {'a':10,'b':30}
x = {'i':11,'j':12}
d |= x
print(d)
merge the dictionary x inside dictionry d
x = {'i':11,'j':12}
output-: {'a':10,'b':30,'i':11,'j':12}
code:
d = {'a':10,'b':30}
x = {'i':11,'j':12}
d |= x
print(d)