---
title: "Comment by Siddharth Rout on \"Five Python Tricks to make your work easy\" | Hashnode"
description: "Merging two dicts is much easier in Python 3.9 with the | operator. x = { &#x27;p&#x27; : 1 , &#x27;q&#x27; : 2 } y = { &#x27;q&#x27; : 3 , &#x27;r&#x27; : 4 }"
url: "https://hashnode.com/posts/five-python-tricks-to-make-your-work-easy/5fc929d6df0f3764e3def955/comment/5fcba57b2e4db7780e48357e"
---

[Discussion](https://hashnode.com/posts/five-python-tricks-to-make-your-work-easy/5fc929d6df0f3764e3def955)

Comment [Five Python Tricks to make your work easy](https://hashnode.com/posts/five-python-tricks-to-make-your-work-easy/5fc929d6df0f3764e3def955)

[Dec 5, 2020](https://hashnode.com/posts/five-python-tricks-to-make-your-work-easy/5fc929d6df0f3764e3def955/comment/5fcba57b2e4db7780e48357e)

Merging two dicts is much easier in Python 3.9 with the `|` operator.

```
x = {'p': 1, 'q': 2}
y = {'q': 3, 'r': 4}

z = x | y
```

If you wanted to simply append the k, v pairs of y to the end of x, you can use the shortcut.

```
x |= y
```

Nevertheless, I would never have thought of your method. Great job!

[Parth Panchal](https://hashnode.com/@parth104)

[Dec 7, 2020](https://hashnode.com/posts/five-python-tricks-to-make-your-work-easy/5fc929d6df0f3764e3def955/comment/5fcba57b2e4db7780e48357e#reply-5fce6788b893f0197d598fa5)

Yes [Siddharth Rout](https://hashnode.com/@sidr2911), Thanks for pointing out. I was also not aware about this new feature of Python 3.9.
