exponentiation

Raising a number to a power, written with two stars in Python: 2 ** 10 is 1024.

In more detail

A fractional exponent gives a root, so 9 ** 0.5 is 3.0, the square root. ** binds more tightly than unary minus and works from right to left, so 2 ** 3 ** 2 is 2 ** 9. pow(x, y) does the same.

Example

2 ** 0.5   # 1.4142135623730951

Related terms

Taught in

References

Certification courses