Operators
/= — True division assignment
Divide and update the target with the quotient. Built-in integer true division produces a float; an integer target is not constrained to remain an integer. A zero numeric divisor raises ZeroDivisionError. The __itruediv__() hook may modify its receiver or supply a replacement. If absent or declining with NotImplemented, normal binary dispatch applies. The result is stored back into the target; this is a statement, not an expression. A failed store does not guarantee rollback.
Formal Syntax & Structure
python syntaxpython
target /= expressionParameters & Attributes
| Name | Type | Description |
|---|---|---|
| target | object | Existing assignable name, attribute, item or slice; its current value participates in the operation. |
| right | compatible nonzero numeric divisor | Value used as the right operand of the operation. |
Working Example
Example Snippetpython
budget = 15previous = budgetbudget /= 4print(budget)print(type(budget).__name__)print(previous)