🐍 Python And It's Libraries 🐍
Pages
Home
google
Python Docmentation
Thursday, June 4
How to Add two Dictionaries in Python
You need to first create the two dictionaries
>>> d1 = {'a':1,'b':2,'c':3} # dictionary 1
>>> d2 = {'d':4,'e':5,'f':6} # dictionary 2
for add two dictionaries you have to use the
Exponent
operator like below
>>> d3 = { **d1, **d2 }
No comments:
Post a Comment
thank Q
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Are you looking for ......
No comments:
Post a Comment
thank Q