In Python 3, they made the / operator do a floating-point division, and added the // operator to do integer division (i.e., quotient without remainder); whereas in Python 2, the / operator was simply integer division, unless one of the operands was already a floating point number.

In Python 2.X:

>>> 10/3
3
>>> # To get a floating point number from integer division:
>>> 10.0/3
3.3333333333333335
>>> float(10)/3
3.3333333333333335

In Python 3:

>>> 10/3
3.3333333333333335
>>> 10//3
3

For further reference, see PEP238.

Answer from Mark Rushakoff on Stack Overflow
🌐
freeCodeCamp
freecodecamp.org › news › what-does-double-slash-mean-in-python
What Does // Mean in Python? Operators in Python
July 21, 2022 - In Python, you use the double slash // operator to perform floor division. This // operator divides the first number by the second number and rounds the result down to the nearest integer (or whole number).
🌐
4Geeks
4geeks.com › how-to › what-does-double-slash-mean-in-python-floor
What Does // Mean in Python?
July 16, 2025 - One of the many operators in Python is the double slash // operator, which refers to an integer division or a division with no remainder/decimals. That is ca...
Discussions

Can someone explain why this line of code requires 2 slashes to work?
One slash will give you a floating point number, two slashes will give you an integer More on reddit.com
🌐 r/learnpython
25
25
November 15, 2024
Does the double slash (or floor division I believe) operator round numbers ending in .4 up?
-2.4 rounding down is -3.0 as -3 < -2.4 I know, it still hurts my brain, too. More on reddit.com
🌐 r/learnpython
7
2
May 26, 2022
notation - How should one interpret a double slash, //? - Mathematics Stack Exchange
Example usage I've seen: $x^2 / (y // z)$ Context: I recently started learning some fundamental electrical engineering, where I saw I calculated the power doing $vs² / (r1 + ron + ron // ro... More on math.stackexchange.com
🌐 math.stackexchange.com
March 31, 2012
Can't get rid of double backslashes in filepaths -
Isolate the error my friend. In your terminal in the same directory use the os library to verify that the file exists. Use os.path to create the file path do not give it the full path and there should be a method to check if it exists. More on reddit.com
🌐 r/learnpython
10
3
January 3, 2022
🌐
Oreate AI
oreateai.com › blog › understanding-the-double-slash-integer-division-in-python › 7377f5389a46e747326328617d0842c2
Understanding the Double Slash: Integer Division in Python - Oreate AI Blog
January 15, 2026 - In Python, the double slash operator // is used for floor division. This means that when you divide two numbers using this operator, it returns the largest integer less than or equal to the result of the division.
🌐
Python
docs.python.org › 3 › library › pathlib.html
pathlib — Object-oriented filesystem paths
5 days ago - A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash.”
🌐
Medium
medium.com › python-basics-beyond › pythons-double-slash-operator-5fa1faa29e6c
Python’s Double Slash Operator. | Python Basics & Beyond
December 3, 2024 - In Python, this is accomplished using the double slash (//) operator. Unlike regular division (/), which returns a decimal number, floor division always gives you an integer result. ... The floor division operator follows a simple rule: it takes the result of normal division and rounds down to the nearest integer. This means...
Find elsewhere
🌐
Python documentation
docs.python.org › 3 › reference › expressions.html
6. Expressions — Python 3.14.3 documentation
5 days ago - This means that you can specify the same key multiple times in the dict item list, and the final dictionary’s value for that key will be the last one given. A double asterisk ** denotes dictionary unpacking.
🌐
Sololearn
sololearn.com › en › Discuss › 2803983 › what-is-double-slash-used-for
What is double slash // used for | Sololearn: Learn to code for FREE!
June 4, 2021 - The double slash operator returns the integer value of the quotient for example "10/4" will give 2.5 but "10//4" will give 2, it just removes the floating point and return an integer not this operator in a function will be "int(10/4)" where ...
🌐
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.
🌐
Quora
quora.com › What-does-this-symbol-mean-28
What does this symbol // mean? - Quora
In some programming languages the double slash (“//”) means the start of a ‘single line comment’. In programming languages like C, C++, Java or Javascript you can write comments in your code and you have 2 ways of doing that: single ...
🌐
TutorialsPoint
tutorialspoint.com › what-does-mean-in-python
What does '//' mean in python?
January 31, 2023 - The double-slash(//) operator returns the result as an integer by rounding off to the nearest integer. Print the result of the floor division of inputNumber_1 by inputNumber_2. The following program returns the floor division of the first number by the second one using the// operator in Python ?
🌐
SPSS Tutorials
spss-tutorials.com › overview-python-operators
Python Operators - Quick Overview & Examples
Quick note: you can use something ... not available in Python unless you import the math module and use math.sqrt(). A double slash in Python is used for floor division: it divides x by y and truncates the result....
🌐
GeeksforGeeks
geeksforgeeks.org › python › benefits-of-double-division-operator-over-single-division-operator-in-python
Benefits of Double Division Operator over Single Division Operator in Python - GeeksforGeeks
January 12, 2026 - In Python, division can be done ... differently and have different use cases. The double division operator (//) performs floor division. This means it divides two numbers and returns the largest integer less than or equal ...
🌐
Reddit
reddit.com › r/learnpython › does the double slash (or floor division i believe) operator round numbers ending in .4 up?
r/learnpython on Reddit: Does the double slash (or floor division I believe) operator round numbers ending in .4 up?
May 26, 2022 -

I'm taking my first programming course in college this semester and we've been tasked with a few basic exercises using mostly if-else statements and the odd very basic for loop. For this particular exercise, one issue I've come with that I hadn't before is when using the // operator. From my understanding + research and what has been taught to me, this operator is supposed to simply round down to the nearest whole number. I won't explain the entire exercise/project's goal, as per the rules of the subreddit, but the specific case I've just observed is when rounding -2.4, or more specifically abs(-2.4). I defined a variable as such:

digit1 = abs(num // 10)

num is a previously defined variable containing an integer input ( int(input("")) ). This variable is used to look for the first digit of the inputted number. When I input -24, the result I expected was 2, but the output ended up being 3. I'm not too sure what's going on. Is the absolute function or the fact that it's a negative number affecting the result?

Also, in case this is relevant, we're using replit as an IDE.

Thanks in advance for any responses.

Sidenote: I apologize if this is a very simple issue that I'm just not seeing. Asked similar questions in other sites and people seemed annoyed at how simple the solution was. Reddit's always been pretty nice but hey, you never know.

🌐
Altcademy
altcademy.com › blog › what-is-double-slash-in-python
What is double slash in Python
February 20, 2024 - When you're first starting out with programming, every symbol or combination of symbols in a programming language can seem like a puzzle. In Python, one such symbol that might cause a bit of head-scratching is the double slash //. This isn't a typo or a mistake; it's a purposeful part of the language that serves a specific function.
🌐
Medium
medium.com › @rajputgajanan50 › what-does-mean-in-python-5e2e8f4de5c0
what does // mean in python. what does // mean in python | by Gajanan Rajput💚 | Medium
February 20, 2024 - ... Here, result is a floating-point number because the division operation yields a non-integer value. Now, let’s introduce the double slash (//), known as the floor division operator.
🌐
TutorialsPoint
tutorialspoint.com › what-does-the-operator-do
What Does the // Operator Do?
In Python, the // is the double slash operator i.e. Floor Divison. The // operator is used to perform division that rounds the result down to the nearest integer. The usage of the // operator is quite easy. We will also compare the results with single slash division.
🌐
Quora
quora.com › How-do-you-change-a-double-backslash-to-a-single-back-slash-in-Python
How to change a double backslash to a single back slash in Python - Quora
A few important notes before my answer code: * To put a backslash in a string literal, type two backslashes. The first one indicates the start of an escape sequence; the second one indicates you want the escape sequence to produce a backslash. (If ...