I am reading a Python book that uses the symbol
<-
It seems to be used interchangeably with the = sign. Is this a normal symbol to explain this? I have never seen it used elsewhere.
It's not a symbol, it's simply showing that when you make an assignment using '=' you are placing the value on the right into the variable on the left.
a <- b
(better formatted as a < -b
) means "a less than minus b" , so
>>> a = -5
>>> b = 3
>>> a <- b
True
>>> a = 3
>>> b = 4
>>> a <- b
False
In your image, as others have pointed out, the author is just indicating an assignment, it's unfortunate that the typography made it look like code, it wasn't meant to be a "less than minus". 😊
It's just a pseudo-code example, not Python syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With