0
How can we get a float when we divide two integers? For this to happen either one of it should be float.
4 Respuestas
+ 6
In python 3, the / operator is for float division. So you will get a float result regardless of if the operands are float or not. For integer division, use //.
E.g
2/1 outputs 2.0
2//1 outputs 2
+ 1
although 2/1 would output 2.0, not 1
0
Thanks.
0
Haha yeah omg i better change that