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
Python is passing "my\\folder\\name" to a function that expects "my\folder\name". Printing the string shows the string with single slashes, and using raw strings doesn't fix the problem.
Printing the string shows the string with single slashes If printing it shows shingle slashes then that's what it has. The doubleslashes are only in "repr" mode, like you would see in errors or lists or something. >>> folderPath = r"H:\Dropbox\02_MyImages" >>> print(folderPath) H:\Dropbox\02_MyImages >>> [folderPath] ['H:\\Dropbox\\02_MyImages'] More on reddit.com
๐ŸŒ r/learnpython
8
8
February 5, 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.
๐ŸŒ
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...
๐ŸŒ
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 ...
Find elsewhere
๐ŸŒ
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 ...
๐ŸŒ
Kodeclik
kodeclik.com โ€บ python-double-slash
Python's Double Slash Operator
October 16, 2024 - Here, the double slash acts as the integer division operator. It returns the floor of the quotient of its operands, without floating-point rounding. Another way to think of integer division is as an operator that returns just the quotient while ...
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ python is passing "my\\folder\\name" to a function that expects "my\folder\name". printing the string shows the string with single slashes, and using raw strings doesn't fix the problem.
r/learnpython on Reddit: Python is passing "my\\folder\\name" to a function that expects "my\folder\name". Printing the string shows the string with single slashes, and using raw strings doesn't fix the problem.
February 5, 2022 -

I have a program that takes a folder name as input. Every time the input is assigned to a variable, all regular slashes become double slashes. Printing the string shows the correct value, but this correct value is not being passed to the function. The double-slash version is being passed to the function. I know this because when I set a breakpoint and hover over the folderPath variable, it shows the double-slash version. This causes the function to fail.

Using raw strings does not solve the problem, although the documentation seems to say that it should. This StackOverflow answer makes me think that the representation of the string, and not the literal value, is being passed to the function. I also tried using folderPath.replace("//", "/"), but that didn't work.

Here is my code:

folderPath =  r"H:\Dropbox\02_MyImages" # becomes "H:\\Dropbox\\02_MyImages"
folderFiles = dropbox.dropbox.Dropbox.files_list_folder(dropboxInstance, folderPath)

Thank you for any help, I really appreciate it.

๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ pathlib.html
pathlib โ€” Object-oriented filesystem paths
1 week 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.โ€