Python 3.8, released in October 2019, adds assignment expressions to Python via the
:=syntax. The assignment expression syntax is also sometimes called “the walrus operator” because
:=vaguely resembles a walrus with tusks.
Assignment expressions allow variable assignments to occur inside of larger expressions. While assignment expressions are never strictly necessary to write correct Python code, they can help make existing Python code more concise. ….. In this tutorial, you will use assignment expressions in several examples to produce concise sections of code.
Source: How To Use Assignment Expressions in Python | DigitalOcean