β„‚π• π•Ÿπ•₯π•šπ•Ÿπ•¦π•¦π•ž

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.