i don't understand about : print (20%6)
4/27/2021 4:56:37 AM
in this context the % is used as the modulo operator. it is the remainder of division.
6 fits in 20 three times. three multiplied by 6 results in 18.
20 subtracted by 18 is 2. so the expression 20%6 evaluates to 2.
oh ok i understand right now
thank you so much Jan Markus
i'm new member
The modulus operator % usually returns the remainder of integer division.
Send us a message