Quick answer: Python uses ** for exponentiation. It follows power-operator precedence, handles negative exponents as floating-point results, and supports efficient modular powers through the three-argument form of pow().

Python uses ** as the exponent operator. The expression base ** exponent raises the base to the given power. For example, 2 ** 5 means two raised to the fifth power.
The exponent operator is part of Python’s numeric expression syntax. It works with integers, floats, decimals, fractions, and other numeric types that implement power behavior. For arrays, libraries such as NumPy also support power operations element by element.
For everyday Python code, ** is the most readable way to write powers. It keeps the expression close to mathematical notation and avoids an extra function call. The important details are precedence, grouping, and result type.
The official Python power operator reference documents the expression rules. For related precedence rules, see the Python order of operations guide. For function-based power examples, see the Python power guide.
Basic Exponent Operator Syntax
Place the base on the left side of ** and the exponent on the right side. The result is the base raised to that exponent.
print(2 ** 5)
print(3 ** 0)
print(10 ** 2)
Any nonzero number raised to the zero power returns one. Positive integer exponents keep integer results when both operands are integers and the result can be represented as an integer.
Python also returns 1 for 0 ** 0. That behavior is useful in many programming formulas, but it can surprise readers coming from a purely mathematical discussion. If the zero-zero case has special meaning in your program, handle it explicitly before evaluating the expression.
Right-To-Left Grouping
The exponent operator groups from right to left. That means 2 ** 3 ** 2 is read as 2 ** (3 ** 2), not (2 ** 3) ** 2.
right_grouped = 2 ** 3 ** 2
left_grouped = (2 ** 3) ** 2
print(right_grouped)
print(left_grouped)
The first expression returns 512, while the parenthesized expression returns 64. Add parentheses whenever the grouping should be obvious to the reader.
This right-to-left grouping is unusual compared with many arithmetic operators. In review, chained powers are easy to misread, so parenthesized expressions are usually better for production code.

Negative Exponents
A negative exponent produces the reciprocal of the positive power, so the result is usually a float.
print(2 ** -3)
print(10 ** -2)
print(4 ** -1)
These examples return fractional values. If exact rational arithmetic matters, use fractions.Fraction instead of relying on binary floating-point results.
One important edge case is zero raised to a negative exponent. Python raises ZeroDivisionError because the operation would require division by zero. Validate input first if the exponent can be negative and the base can be zero.
Negative Bases And Precedence
Unary minus binds differently than many people expect. The expression -2 ** 2 means -(2 ** 2), not (-2) ** 2.
print(-2 ** 2)
print((-2) ** 2)
print((-2) ** 3)
Use parentheses when a negative base should be raised to a power. Without parentheses, Python applies the exponent first and then applies the leading minus sign.

Compare ** And pow()
The built-in pow() function can do the same basic calculation as **. It also has a three-argument form for modular exponentiation.
print(2 ** 10)
print(pow(2, 10))
print(pow(2, 10, 1000))
The three-argument form pow(base, exponent, modulus) is useful in algorithms that need a power result reduced by a modulus. The ** operator does not include that third argument.
Modular exponentiation is common in hashing, number theory, and cryptography-related exercises. The three-argument pow() form is preferred there because it avoids creating a huge intermediate result before applying the modulus.
Compare ** And math.pow()
math.pow() converts its arguments to floats and returns a float. The ** operator can preserve integer results for integer powers.
import math
integer_result = 10 ** 20
float_result = math.pow(10, 20)
print(integer_result)
print(float_result)
print(type(integer_result).__name__)
print(type(float_result).__name__)
Use ** for normal Python numeric expressions. Use math.pow() only when float behavior is specifically what you want.
Python integers can grow as large as memory allows, so ** can produce extremely large exact integer results. That is powerful, but it can also make accidental large powers expensive. Put limits around user-provided bases or exponents in long-running services.

Common Mistakes
The first mistake is using ^ for powers. In Python, ^ means bitwise XOR. Use ** for exponentiation.
The second mistake is forgetting right-to-left grouping. If multiple powers appear in one expression, add parentheses around the part that should run first. This makes mathematical intent clear.
The third mistake is expecting every power result to be an integer. Negative exponents and float operands can produce floats. Very large integer powers can also create very large integers, so be careful in loops and user-controlled calculations.
For most Python code, the rule is simple: use base ** exponent for powers, add parentheses for negative bases or chained powers, use pow() when modular exponentiation is needed, and avoid ^ unless you really mean XOR.
Use ** For Powers
The double-star operator raises its left operand to the right operand. It works with integers and floating-point values, but the result type and edge cases depend on the operands. The caret character is not an alias: Python reserves ^ for bitwise XOR.
base = 3
exponent = 4
print(base ** exponent)
print(2 ^ 3) # bitwise XOR, not a power

Parenthesize A Negative Base
Power binds more tightly than a unary minus on the left, so -1 ** 2 is parsed as -(1 ** 2). If the negative number is the mathematical base, write parentheses. This small distinction matters in formulas, tests, and generated expressions.
print(-1 ** 2)
print((-1) ** 2)
print(2 ** -3)
Use pow() For Modular Arithmetic
pow(base, exponent) is equivalent to base ** exponent for ordinary powers. pow(base, exponent, modulus) performs modular exponentiation without first materializing the full power, which is useful for integer algorithms and cryptographic-style calculations. Use it only with the integer contract it requires.
print(pow(2, 10))
print(pow(2, 100, 11))
Check Python’s power-operator rules when precedence or numeric types affect a result.
For nearby numeric operations, compare Python powers, rounding results, and rounding down when the output type matters.
Frequently Asked Questions
What is the exponent operator in Python?
Python uses ** for exponentiation, so 2 ** 3 evaluates to 8.
Is ^ the exponent operator in Python?
No. ^ is bitwise XOR in Python; use ** or pow() for powers.
Why does -1 ** 2 equal -1?
The power operator binds more tightly than a unary minus, so Python evaluates -(1 ** 2); write (-1) ** 2 when the base is negative.
When should I use pow() instead of **?
Use pow(base, exponent) when it reads better, and use pow(base, exponent, modulus) for efficient modular exponentiation with integers.