0
dividing numbers
hey, in python shell, i tried to calculate the outcome of this: 6+4/2, and the answer was 8 and 4+6/2 and the answer was 7, now what is the difference between these two?
4 odpowiedzi
+ 8
You can see this in that way how its calculated, according to the operator precedence. See python docs 3.7, 6.16 'operator precedence':
6 + (4 / 2) -> 6 + 2 -> 8
4 + (6 / 2) -> 4 + 3 -> 7
+ 2
Menno Saedi
Try to lookup on the net for "Python operator precedence" 👍