Concept
Exponents (**)
To raise a number to a power, use double asterisks `**`:
python
print(2 ** 3) # Prints: 8 (2 * 2 * 2)
# 18. Exponents (**) To raise a number to a power, use double asterisks `**`: ```python print(2 ** 3) # Prints: 8 (2 * 2 * 2) ``` Never use `^`. In Python, `^` does bitwise math and will silently give you completely wrong answers while pretending everything is fine.
Checkpoint
What happens if you type `2 ^ 3` expecting 8?
Practice
Calculate $3^4$ ($3 \times 3 \times 3 \times 3$) using `**` and print the result.
01
Tap code blocks below to assemble
Available Blocks