blogs

Walrus Operator

Using an Arctic Tank with a Data Snake What IS a Walrus? USFWS via PIXNIO, licensed under Creative Commons, CC0. Data science marine biologists rejoice! In-line assignment is possible as of Python 3.81 (released in Oct. 2019)2. The walrus operator (:=) sets a variable to a value, just like = - but importantly - IT RETURNS A VALUE. This may not seem very useful, and often times, it isn’t. However, this means that variable assignment can be done in line.