← Go Back
The
How to Raise a Number to a Power
In Python, exponentiation is done with the** operator. For example, to calculate 23:>>> 2**3
8
The
pow() built-in function can also be used:>>> pow(2, 3)
8
🐍 You might also find interesting: