What us the operator := in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What us the operator := in python?

What is := operator for exactly, why not just using = ?

3rd Oct 2018, 12:28 PM
ifl
ifl - avatar
4 Answers
+ 2
In addition to Janningā­ 's answer: In maths you use the extra colon ':' to know which side is defined as which. `x := 5` means "x is defined as 5", but you could also write that as `5 =: x`. However `5 := x` means the opposite, "5 is defined as x"
3rd Oct 2018, 1:31 PM
Schindlabua
Schindlabua - avatar
26th Sep 2020, 3:25 PM
Balaji
Balaji - avatar
+ 2
I have never seen this operator šŸ˜•
3rd Oct 2018, 12:35 PM
KrOW
KrOW - avatar
3rd Oct 2018, 12:39 PM
Janningā­
Janningā­ - avatar