Operator Functions
operator.imod()
Apply in-place modulo. Return the operation result; the function cannot rebind the caller’s variable. Assign the returned object when the target may be replaced.
Formal Syntax & Structure
python syntaxpython
operator.imod(a, b, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| a | object | Left operand or target object. |
| b | object | Right operand. |
Return Value
object
The object result described above.
Working Example
Example Snippetpython
import operatorprint(operator.imod(-7, 3))