+ 1
How?
I dont understand %7(5//2)
6 ответов
+ 7
Do you mean 7%(5//2) ?? You should be more specific with your question, so that people can better help you.
+ 3
Assuming you meant 7%(5//2), the code will run the equation using order of operations, meaning anything in the brackets will run first. 5//2 will find the number of times 2 can go into 5 without going over it or going into decimal places. This means that the outcome of that will be 2 (2*2=4, multiplying 2 by 2 becuase it is the largest number 2 can be multiplied by before going over 5 (2*3=6)). So now, we are left with 7%2. The modulo (%) operator will take the remainder of the division of the 2 operands while again still not going into decimals (7÷2=3 with a remainder of 1). So the result will be 1.
+ 3
good answer, @Faisal
0
I don’t understand 7%(5//2)
0
7%(5//2)
is the same
get the integer quocient of 5÷2, it is: 2
because 2x(2)+1 = 5
Now tell what is the rest of the division: 2÷2;
it is: 2×(3)+1 .. look ! here the quocient can be ignored. The division // just orint the rest of a division.
So: 7//(5% 2) == 7//(2) == 1
0
try make check many operations with // and % to identify what is happening.