+ 1
why this results to 495? can someone explain?
a = 5 b = 10 b, a = a, b print (b*a*a-b) 10*5*5-10 --i think i missed something
3 Respuestas
+ 2
Yes, you did.
b, a = a, b basically switches the two variables. So it's not 10 * 5 * 5 - 10, but 5 * 10 * 10 - 5, which is 495
+ 3
a=5
b=10
After b,a=a,b
a=10
b=5 then
b*a*a-b= 5*10*10-5=500-5 =495
+ 1
Ohhh i see , thank youuu that's also what i thought about thanks for clarifying 😊 Godbless you!