Walrus operator:
The Walrus or := operator is one of the latest additions to python 3.8.
It is an assignment operator that lets you assign value to a variable within an expression like conditional statements, loops, etc.
Example
If we want to check and print the length of a list:
Mylist = [1,2,3]Output
if(l := len(mylist) > 2)
print(l)
3
Share and Support
@Python_Codes
>>Click here to continue<<