In Python, the % operator is used as the modulus operator. It calculates the remainder of the division between two numbers. The % operator works with both integer and floating-point numbers.
Explanation:
Lets see
5/2 = 2 and the remainder is 1. So if we write 5%2 in python we get as a result the number 1.
Answers & Comments
Answer:
In Python, the % operator is used as the modulus operator. It calculates the remainder of the division between two numbers. The % operator works with both integer and floating-point numbers.
Explanation:
Lets see
5/2 = 2 and the remainder is 1. So if we write 5%2 in python we get as a result the number 1.