0

How should I expect Python to handle a simple floating point calculation like this:

float(6/4)

The output from this in the shell is

1.0

I would expect this to be 1.5, so what gives?

Lazloman
  • 1,219
  • 4
  • 22
  • 47

1 Answers1

1

Python is using integer division here.

lhf
  • 67,570
  • 9
  • 102
  • 136