DEV Community

Cover image for Python 3.9
Desmond
Desmond

Posted on

Python 3.9

Python 3.9 🥳 is out and my favourite feature is the dictionary union operator.

Example


a = {1: 'dog', 2: 'cat', 3: 'rabbit'}
b = {4: 'snake', 5: 'python'}
c = a | b
print(c)

# {1: 'dog', 2: 'cat', 3: 'rabbit', 4: 'snake', 5: 'python'}
Enter fullscreen mode Exit fullscreen mode

Read the official Docs

Top comments (1)

Collapse
 
fawaz441 profile image
Abdulsalam Fawaz Akolade

Nice