+ 5
I dont understand how the modulo operator on Python works can someone help
modulo operator
4 odpowiedzi
+ 6
It returns the remainder of the integer division. Check out explanations below:
https://www.sololearn.com/discuss/1212950/?ref=app
https://www.sololearn.com/discuss/989220/?ref=app
https://www.sololearn.com/discuss/975387/?ref=app
+ 2
modulus provides the remainder:
10/3 = 3 remainder 1
therefore
10%3=1
12/3 = 4 (with no remainder)
therefore
12%3=0
hope this helped a little🙈
0
Maybe you are curious about these ones below:
20%(-6)
(-20)%6
(-20)%(-6)
0
20%(-6)
(-20)%6
(-20)%(-6)