There are two ways to compute in Python. You
can write it as “xy”. There is also a function that does the same
thing:
x**y
pow(x,y)
For integer arithmetic, the function also has a
three-argument form that computes , but more efficiently than if
you used that expression:
xy%z
pow(x,y,z)
Examples:
>>> 2**4 16 >>> pow(2,4) 16 >>> pow(2.5, 4.5) 61.763235550163657 >>> (2**9)%3 2 >>> pow(2,9,3) 2