+ 4
x=4 x*=3 print(x)
So Iâm kinda confused here I already put in the code and the answer is 12 but I donât know what is happening in this code
10 Respostas
+ 2
4*3= 12 đ
+ 2
It's easy :)
You can also use this equation x*=3 is the same with x*3
4 * 3 = 12
+ 1
x*=3 is interpreted as x=x*3
+ 1
Ohh alright i got it i thought that the x on the left side was 4 and the other one on the right was 4 like this 4=4*3
+ 1
In second line, you can also use this equations x*=3 is the same with x = x*3
When you initialize x first, it equals 4. If you initialize again as x*=3 (x multiple by 3, so 4*3=12) it equals 12.
Happy coding!
+ 1
You are welcome
<3
+ 1
Thank you for the help.
0
4 * 3 = 12
0
First, you are assigning 4 to x. So the value of x is 4. Then you are doing x *= 3 which means x = x * 3 which translates to x = 4 * 3 (because you assigned 4 to x). So, you ar now assiging 4 * 3 or 12 to x.
That's why, x is 12
Hope you got the point. Thank you
0
Yeha i do thank you