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

What is the difference between / and // in operators???

Pls explain briefly

10th Jan 2019, 10:19 AM
Purvaja Durga
Purvaja Durga - avatar
3 Answers
+ 5
5/2 == 2.5 # type float 5//2 == 2 # no decimals, type int
10th Jan 2019, 10:45 AM
HonFu
HonFu - avatar
+ 2
Thank you
10th Jan 2019, 1:24 PM
Purvaja Durga
Purvaja Durga - avatar
+ 2
/ produces a float // produces floor division if I'm not mistaken
10th Jan 2019, 4:07 PM
James Watkins
James Watkins - avatar