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,289
  • 5
  • 25
  • 50

1 Answers1

1

Python is using integer division here.

lhf
  • 70,581
  • 9
  • 108
  • 149