Modulo, division and exponentiation in Python.
Modulo, division and exponentiation:
MODULO:
The operator named modulo which is represented by % sign returns the remainder of the division of the number at its left by the number on its right side.
e.g.
print(7%4)
Answer: 3
DIVISION:
To divide we can use /
e.g.
print(4/8)
Answer: 0.5
EXPONENTIATION:
The operator named exponentiation in Python is represented with ** sign. It increases the number on its left to the power of the number on its right side.
print(3**4)
Answer is: 81
Comments
Post a Comment