0
why is 7% (5//2)=1
4 Answers
+ 7
// is the integer division operator, which basically means it rounds decimals down to the nearest whole number. So 5//2 equals 2
Then % is the modulo operator, which just returned the remainder from dividing two numbers. In this case the remainder of 7/2 is 1
+ 1
the // is a truncating division operator which rounds down your integer division answer to integer without float and then 7%2 is 1
0
1
0
Roger that