Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in Python by (47.6k points)

Is there a modulo function in the python math library?

Isn't 15 % 4, 3? But 15 mod 4 is 1, right?

1 Answer

0 votes
by (106k points)
edited by

You can use the modulo operator(%), it gives you the remainder as well as the modulo.

See the example below:-

15 % 4

image

To know more about this you can have a look at the following video:-

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...