Python Power Assignment

Python power assignment is done with **=, the power assignment operator.

Example:

>>> x = 2
>>> x **= 3
>>> x
8

Read more about the Python power operator

You can’t do power and assign to an undefined variable

>>> d **= 3
Traceback (most recent call last):
  File "`<stdin>`", line 1, in `<module>`
NameError: name 'd' is not defined

You can’t do power and assign to a literal

>>> 3 **= 3
  File "`<stdin>`", line 1
SyntaxError: can't assign to literal