Operator Functions
operator.neg()
Apply unary minus to the object.
Formal Syntax & Structure
python syntaxpython
operator.neg(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.neg(5))