Remainder question!!!! So, it is about remainders in Python programing language.
ID: 3664777 • Letter: R
Question
Remainder question!!!!
So, it is about remainders in Python programing language.
I'm running a loop to check whether certain numbers are valid for "some condition".
<M doesn't divide N.>
M = {4,9,16,25,36 and so on }
N = {2,3,4,5, ....,n-1,n }
For cases like: ( 4%2 == 0) -->True, M does divide N ... It is easy
For other cases like: 6%4, 8%16 --->?... these cases don't give me 0 as remainder and I'm not able to figure what to do to here.
I want to conclusively say that 6%4 is a factor of M even though it's remainder is not 0.
Explanation / Answer
You got the syntax wrong.
a%b is the reminder when a is divided by b.
So, 6%4 = 2
8%16 = 8 but 16%8 = 0