โ„‚๐• ๐•Ÿ๐•ฅ๐•š๐•Ÿ๐•ฆ๐•ฆ๐•ž

Modulus vs Percent

Last update: 2024-01-04

Tags: python โ€“

Why is the % character a โ€œmodulusโ€ and not a โ€œpercentโ€? Mostly thatโ€™s just how the designers chose to use that symbol. In normal writing you 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. (Shaw, 2017)

Reference

Shaw, Z. (2017). Learn Python 3 the Hard Way: A Very Simple Introduction to the Terrifyingly Beautiful World of Computers and Code (4th edition). Addison-Wesley Professional.