Python Exponentiation Operator
In Python, Arithmetic Exponentiation Operator takes two operands and returns the result of the first operand raised to the power of second operand.
Syntax
The syntax to find the base a
raised to the power b
using Exponentiation Operator is
</>
Copy
a ** b
The above expression returns a number.
Example
In the following program, we take two numbers: a, b; and find the value of a
raised to the power b
.
main.py
</>
Copy
a = 5
b = 4
result = a ** b
print(result)
Output
625
Conclusion
In this Python Tutorial, we learned about Arithmetic Exponentiation Operator, its syntax, and usage, with examples.