+ 1
Please anyone explain this to me ???
num1, num2 =3,3 num1-=3 num2 = -3 print(num1 + num2)
4 Respostas
+ 6
In first(num1-=3) you're subtracting 3 from original value and in 2nd case you are changing num2 value to -3
So the output will be -3
+ 3
num1 is initially 3.
"num1-=3" gives 3-3 which is 0.
num2 is initially 3.
Now "num2=-3" changes the initial value of num2 from 3 to -3.
So "print(num1+num2)" will print the sum of the final values of both num1 which is 0 and num2 which is -3 and gives 0+-3= -3.
+ 1
3-3 will be 0 then
0
yaa tq i got it