What dose this % mean in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What dose this % mean in python

Hi i'm learning python and I dk what this % mean i

8th Aug 2018, 1:11 PM
khaild
khaild  - avatar
3 Answers
+ 1
modulo
8th Aug 2018, 1:32 PM
Markus Kaleton
Markus Kaleton - avatar
0
E.g; 10 % 3 = 1 10 % 2 = 0
8th Aug 2018, 1:46 PM
Sousou
Sousou - avatar
0
Modulo (remainder) This operator takes two operands, divides them, and returns the remainder. Examples: 6%2 This is zero. 6 divided by 2 is exactly 3, no remainder. 6%4 This is two 6 divided by 4 is one, two remainder. 5%6 This is 5. If the second operand is larger than the first, the first is returned.
8th Aug 2018, 1:47 PM
Paul Grasser
Paul Grasser - avatar