2015年4月18日 星期六

[python] " //= assignment operator"


What does the //= assignment operator do in Python - Stack Overflow
http://stackoverflow.com/questions/9493647/what-does-the-assignment-operator-do-in-python


9.9. operator — Standard operators as functions — Python 2.7.10rc0 documentation
https://docs.python.org/2/library/operator.html


For the code
x = 16
x //= 2
The value of x is 8. Basically, x = x // 2, integer division


沒有留言:

張貼留言