fork download
  1. a = 9.0
  2. b = 2.0
  3.  
  4. print (a//b) # floor division gives `4.0` instead of `4.5`
  5.  
  6. a = 9
  7. b = 2
  8.  
  9. print (a/b) # int division because both `b` and `a` are `int` => `4`
  10. print (a//b) # float division returns `4`
  11.  
  12. a = 9.0
  13. b = 2
  14.  
  15. print (a/b) # float division gives `4.5` because `a` is a float
  16. print (a//b) # floor division fives `4.0`
Success #stdin #stdout 0.1s 10104KB
stdin
Standard input is empty
stdout
4.0
4.5
4
4.5
4.0