Can you explain what's happening with python shell..
>>> 6/7
0
>>> -6/7
-1
>>> -(6/7)
0
Can you explain what's happening with python shell..
>>> 6/7
0
>>> -6/7
-1
>>> -(6/7)
0
With the / operator python always rounds to minus infinity (so to the "more negative" value) if you input integers, like stated in the python docs. This explains the described behavior.
So 6/7 would be 0.857... and gets rounded to 0 while -6/7 gives -0.857... and will be rounded to -1. Finally -0 equals 0.