i don't understand about : print (20%6) | Sololearn: Learn to code for FREE!

+2

i don't understand about : print (20%6)

i don't understand about : print (20%6)

4/27/2021 4:56:37 AM

ឈៀង សៀងហេង

4 Answers

New Answer

+6

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.

+2

oh ok i understand right now thank you so much Jan Markus

+1

+1

The modulus operator % usually returns the remainder of integer division.