The Walrus Operator in Python
Learn what the walrus operator is and how to use it in Python
Published in
4 min readMar 5, 2021
The walrus operator, introduced in Python 3.8, offers a way to accomplish two tasks at once: assigning a value to a variable, and returning that value, which can sometimes offer a way to write shorter, more readable code, that may even be more computationally efficient.