Operators
/ — True division
Divides the left numeric value by the right. Integer operands produce a float, and complex operands support complex division. Built-in division by zero raises ZeroDivisionError. Float results may be rounded, and huge integer quotients may overflow float representation. Custom dispatch uses __truediv__ and __rtruediv__. Unlike //, this operation does not request a floored quotient.
Formal Syntax & Structure
python syntaxpython
left / rightParameters & Attributes
| Name | Type | Description |
|---|---|---|
| left | number or supporting object | Dividend. |
| right | number or supporting object | Nonzero divisor for built-in numeric values. |
Return Value
number or custom result
Numeric result for supported built-in numbers; custom methods can return other objects.
Working Example
Example Snippetpython
print(7 / 2)print(8 / 4)print((4 + 2j) / 2)