Home »
MCQs »
Python MCQs
What is the name of the operator ** in Python?
13. What is the name of the operator ** in Python?
- Exponentiation
- Modulus
- Floor division
- None of the mentioned above
Answer: A) Exponentiation
Explanation:
The ** is an exponentiation operator in the Python programming language. In Python, the ** operator is used to raise the number on the left to the power of the exponent on the right, which is represented by the symbol **. In other words, in the expression 2 ** 3, 2 is raised to the third power, which is a positive number. In mathematics, we frequently see this expression written as 23, but what is really happening is that the numbers 2 and 3 are being multiplied by themselves three times. In Python, we would get the same result of 8 by running either 2 ** 3 or 2 * 2 * 2.