What is the difference between 5/3 and 5//3 in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the difference between 5/3 and 5//3 in python?

16th Apr 2017, 5:59 PM
Vignesh
Vignesh - avatar
3 Answers
+ 6
5/3 = 1.666666 (normal division) 5//3 = 1 (floor division, returns a whole number)
16th Apr 2017, 6:03 PM
Tamás Barta
Tamás Barta - avatar
+ 1
In python3 5/3 is a floating point number (1,6666...) and 5//3 an integer (1).
16th Apr 2017, 6:04 PM
merkrafter
+ 1
Thank you guys
16th Apr 2017, 6:05 PM
Vignesh
Vignesh - avatar