-3

What is ** (two asterisks) used for in Python?

Like, exampleVariable = 5 ** 5

Thanks for any help!

TheTechRobo the Nerd
  • 1,249
  • 15
  • 28

2 Answers2

2

** is used as exponent. So 2 ** 2 is 2 to the second power, or 3 ** 3 is 3 to the third power, or 27.

TheTechRobo the Nerd
  • 1,249
  • 15
  • 28
joelanbanks3
  • 318
  • 3
  • 14
2

It is the operator for exponentiation. 5 ** 5 means "five to the power of five"

cpk
  • 106
  • 3