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

preview_player
Показать описание
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)
Рекомендации по теме
join shbcf.ru