Search code examples
pythonpython-3.x

What does the python operator =- do?


What does the python operator =- do? I'm not asking about the -= operator, which I realize is shorthand for x = x - value.


Solution

  • Actually, the operator =- does not exist. It is only = (- value). So the negative of the value.

    Example:

    >>> x =- 1
    >>> x
    -1