0

If Python is a strongly typed language, why does it convert integers to floats during division?

24th May 2020, 6:49 PM
Ali Rezaei
Ali Rezaei - avatar
5 Answers
+ 3
Guido decided so.😉 In python 2 the conversion wasn't done
24th May 2020, 6:59 PM
Oma Falk
Oma Falk - avatar
+ 1
Use floor division //
25th May 2020, 2:46 PM
Hisham YUM 🇲🇦
Hisham YUM 🇲🇦 - avatar
0
Doesn't it?
24th May 2020, 6:53 PM
Oma Falk
Oma Falk - avatar
0
Yes it does, but why?
24th May 2020, 6:54 PM
Ali Rezaei
Ali Rezaei - avatar
0
Ali Rezaei you can use integer division operator in case if you don't won't float conversion. print(2/3) #float division print(2//3) #interger divsion
24th May 2020, 10:58 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar