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 / right

Parameters & Attributes

NameTypeDescription
leftnumber or supporting objectDividend.
rightnumber or supporting objectNonzero 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)
Python Reference