DEV Community

DDSRY
DDSRY

Posted on

Why is the % character a "modulus" and not a "percent" in Python?

Mostly that's just how the designers chose to use that symbol.

▪ In normal writing, we are correct to read it as a "percent."

▪ In programming, this calculation is typically done with simple
division and the / operator.

▪ The modulus is a different operation that just happens to use the % symbol.

Top comments (1)

Collapse
 
moopet profile image
Ben Sinclair

This isn't peculiar to Python. % is used as modulus in the majority of programming languages (though not all!)