Question #6480
Submitted by Answiki
on 08/21/2022 at 08:31:40 PM UTC
In Python, what is the difference between / and // when used for division?
Merged questions
Answer
Submitted by Answiki
on 12/31/2020 at 06:03:13 PM UTC
In Python 3.x, there are two operators for the division :

5 / 2
returns 2.5
(floating point division) 
5 // 2
returns 2
(floor or integer division)
Note that 5 // 2
returns 3
.
Question by Answiki 08/21/2022 at 08:31:40 PM
In Python, what is the difference between / and // when used for division?
Question by Answiki 12/31/2020 at 06:25:16 PM
What is the difference between '/' and '//' operators in Python?
Answer by Answiki on 12/31/2020 at 06:03:13 PM
In Python 3.x, there are two operators for the division :

5 / 2
returns 2.5
(floating point division) 
5 // 2
returns 2
(floor or integer division)
Note that 5 // 2
returns 3
.
Answer by Answiki on 12/31/2020 at 06:02:40 PM
In Python 3.x, there are two operators for the division :

5 / 2
returns 2.5
(floating point division) 
5 // 2
returns 2
(floor or integer division)
Note that 5 // 2
returns 3
.
Answer by Answiki on 12/31/2020 at 05:52:41 PM
In Python 3.x, there are two operators for the division :

5 / 2
will return 2.5
(floating point division) 
5 // 2
will return 2
(floor or integer division)
Question by Answiki 12/31/2020 at 05:49:24 PM
In Python, what is the difference between '/' and '//' when used for division?
#  ID  Query  URL  Count 

Icons proudly provided by Friconix.