0

Whenever in the python console 3/4 is typed and executed, the output is 0 instead of 0.75. Why?

2nd Sep 2016, 7:42 AM
Aniket Gajjar
Aniket Gajjar - avatar
1 Resposta
+ 1
because it's type is int so int(3/4) = 0 if you want 0.75 , you can try float(3/4)
2nd Sep 2016, 7:54 AM
beauty1234