Operator Functions
operator.invert()
Invert integer bits; for integers ~x equals -x-1. Other objects may implement inversion.
Formal Syntax & Structure
python syntaxpython
operator.invert(obj, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| obj | object | Object to inspect or copy. |
Return Value
object
The object result described above.
Working Example
Example Snippetpython
import operatorprint(operator.invert(5))