+ 1
Why is 1 or 0 when i put x%=2 and my variable x i set 2 or another pair number
For example x=8 x=x%2 if i run this the result is 1, why?? But y=x%2 this is 0 I don't understand
5 Antworten
+ 5
x = 8
x = x % 2
print(x)
The above prints 0. If you are still getting 1 as a result, there should be other factors in play and we will need to view more of your code to understand what is going on.
+ 4
Result is 0 anyway.
https://code.sololearn.com/cDLX353dMIyv/?ref=app
+ 2
Thanks a lot, i realized my error, plop i had put before x+=3 and i forgot python is dynamic en serio gracias!! :D