Power Calculation in Python

Level 114 keystrokes

This calculates 2 to the power of 10 (2^10) and prints 1024. The ** operator performs exponentiation.

Python code

# ** is the exponentiation operator: 2 ** 10 means 2 to the power of 10
# That is ten 2s multiplied together, so 1024 is printed
1print(2 ** 10)

Output

1024
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Python code and how often they appear.

  • *× 2
  • (× 1
  • )× 1

More Python examples at level 1

← Python typing practice