loading...
Cover image for Python 3.9

Python 3.9

nyamador profile image Desmond ・1 min read

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'}

Read the official Docs

Discussion

markdown guide