+ 3
floats
In this following example, why would it output "5.0" and not "5"? >>> 10 / 2 5.0
1 Réponse
+ 4
Because in Python 3 it always returns a float.
If you want an integer use 10//2 or int(10/5)
In this following example, why would it output "5.0" and not "5"? >>> 10 / 2 5.0