[PYTHON] Create a new dict that combines dicts

Like the list

dict_a + dict_b

Even if you write, you can not combine dictionaries, so I thought that I had to write a loop and combine it by myself, but this is one shot.

{**dict_a, **dict_b}

(Because I was told in the comments)

dict_a += dict_b

If you want to do something

dict_a.update(dict_b)

I will meet you. I'm wondering if both + and + = operators are okay.

Recommended Posts

Create a new dict that combines dicts
Create a new Python numerical calculation project
[Python] Create a LineBot that runs regularly
Create a bot that boosts Twitter trends
Create a page that loads infinitely with python
Create a BOT that displays the number of infected people in the new corona
Python: Create a class that supports unpacked assignment
Try to create a new command on linux
Create a new page in confluence with Python
Until you create a new app in Django
Create a fake class that also cheats is instance
Create a chatbot that supports free input with Word2Vec
Create a Django schedule
dict in dict Makes a dict a dict
Create a Bootable LV
Create a Python environment
Create a slack bot
Create a web application that recognizes numbers with a neural network
Create a PythonBox that outputs with Random after PEPPER Input
Create a new csv with pandas based on the local csv
Create a QR code that displays "Izumi Oishi" by scratch
[Python] Create a linebot that draws any date on a photo
Let's create a script that registers with Ideone.com in Python.
Create a life game that is manually updated with tkinter
Let's create a Docker environment that stores Qiita trend information!
Create code that outputs "A and pretending B" in python
Tornado-Let's create a Web API that easily returns JSON with JSON
Create a new list by combining duplicate elements in the list
Create a web API that can deliver images with Django