+ 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 Réponses
+ 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