There is no operator.div in Python 3, no; that only existed in Python 2.

There is a operator.truediv() function instead, as well as a operator.floordiv() function. The reason for this division (no pun intended) is that the old Python 2 / operator would return an integer if both operands are integers, a float otherwise, while these two functions always return the same type, regardless of the type of inputs.

Answer from Martijn Pieters on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › division-operators-in-python
Division Operators in Python - GeeksforGeeks
In Python, division operators allow you to divide two numbers and return the quotient. But unlike some other languages (like C++ or Java), Python provides two different division operators, each behaving slightly differently.
Published   September 17, 2025
🌐
Educative
educative.io › answers › what-are-division-operators-in-python
What are division operators in Python?
Python offers several division-related operators—/ for true division, // for floor division, and % for modulus, each catering to different needs. Floor division (//) returns an integer or a float, depending on the inputs, while true division ...
🌐
Hyperskill
hyperskill.org › university › python › integer-division-operator-in-python
Integer Division Operator in Python
December 25, 2025 - In Python, integer division, also referred to as floor division, involves discarding the remainder and returning the whole number part of the quotient. To perform division, in Python, you use two slashes (//). For instance, if you wish to divide two numbers and get the part of the outcome, ...
🌐
Python
peps.python.org › pep-0238
PEP 238 – Changing the Division Operator | peps.python.org
We propose to fix this by introducing different operators for different operations: x/y to return a reasonable approximation of the mathematical result of the division (“true division”), x//y to return the floor (“floor division”). We call the current, mixed meaning of x/y “classic division”. Because of severe backwards compatibility issues, not to mention a major flamewar on c.l.py, we propose the following transitional measures (starting with Python 2.2):
🌐
W3Schools
w3schools.com › python › pandas › ref_df_div.asp
Pandas DataFrame div() Method
The div() method divides each value in the DataFrame with a specified value.
🌐
Noble Desktop
nobledesktop.com › division in python
Division in Python - Free Video Tutorial and Guide
June 5, 2025 - There are three division types in Python. The first is regular division. Five divided by three will give you a result. The second type of division is floor division. Floor division is how many times three can fit into five. So, in this case, it's only once. Floor division is useful when you need to get a whole number, as it rounds down.
Find elsewhere
🌐
Wiingy
wiingy.com › home › learn › python › division operators in python
Division Operators in Python
January 30, 2025 - The division operator “/” always returns a floating-point number, while the “//” operator returns an integer. The behavior of the division operators depends on the types of the operands.
🌐
Flexiple
flexiple.com › python › division-operator-python
Division Operator In Python - Flexiple
Integer division, or floor division, in Python is performed using the floor division operator //. This operator divides two numbers and rounds down the result to the nearest whole number, effectively "flooring" the result to the integer part.
🌐
Programiz
programiz.com › python-programming › pandas › methods › div
Pandas div()
The div() method is used to divide one DataFrame by another DataFrame, element-wise, or with scalar values. The div() method in Pandas is used to divide one DataFrame by another DataFrame, element-wise.
🌐
OpenStax
openstax.org › books › introduction-python-programming › pages › 2-5-dividing-integers
2.5 Dividing integers - Introduction to Python Programming | OpenStax
March 13, 2024 - If one line of code floor divides by m, the next line will likely modulo by m. The unit m by which an amount is divided is called the modulus. Ex: When converting centimeters to meters, the modulus is 100. ... A program has the line pounds = ounces // 16. What is likely the next line of code? ... Having a mobile device can be a lifesaver on long road trips. Programs like Google Maps find the shortest route and estimate the time of arrival. The time of arrival is based on the current time plus how long the trip will take. Write a program that (1) inputs the current time and estimated length of a trip, (2) calculates the time of arrival, and (3) outputs the results in hours and minutes.
🌐
Analytics Vidhya
analyticsvidhya.com › home › mastering the division operator in python
Mastering the Division Operator in Python - Analytics Vidhya
May 14, 2025 - This extensive manual ventures into the depths of the division operator in Python, encompassing its diverse manifestations and utilities. We will scrutinize integer division, float division, floor division, and truncating division, furnishing lucid elucidations and illustrative instances for each variant.
🌐
W3Schools
w3schools.com › python › ref_func_divmod.asp
Python divmod() Function
Python Examples Python Compiler ... Python Training ... The divmod() function returns a tuple containing the quotient and the remainder when argument1 (dividend) is divided by argument2 (divisor)....
🌐
LearnDataSci
learndatasci.com › solutions › python-double-slash-operator-floor-division
Python Double Slash (//) Operator: Floor Division – LearnDataSci
In Python, we can perform floor division (also sometimes known as integer division) using the // operator.
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.Series.div.html
pandas.Series.div — pandas 3.0.1 documentation
>>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"]) >>> a a 1.0 b 1.0 c 1.0 d NaN dtype: float64 >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"]) >>> b a 1.0 b NaN d 1.0 e NaN dtype: float64 >>> a.divide(b, fill_value=0) a 1.0 b inf c inf d 0.0 e NaN dtype: float64
🌐
HackerRank
hackerrank.com › challenges › python-division › tutorial
Python: Division | HackerRank
In Python 2, the only standard division operator is '/'. If both values are integers, the result is an integer. If either of the values is a float, the return is a float.
🌐
Execute Program
executeprogram.com › courses › python-for-programmers › lessons › two-division-operators
Python for Programmers: Two Division Operators
Learn programming languages like TypeScript, Python, JavaScript, SQL, and regular expressions. Interactive with real code examples.