-1

I'm using Spyder (Python 2.7)

Any division that would return a value below 1 returns 0.

When I use float(5/10) it returns 0.0

When I use: '%.11f'%a after defining a = 10/20 it still returns 0.000000000..

I'm really new to Python, I'm sorry if this is a dumb question.

How do I fix this? Thank you

Cedric Oeldorf
  • 579
  • 1
  • 4
  • 10

1 Answers1

-1

Very noob.

For this to work one must just import:

from __future__ import division
Cedric Oeldorf
  • 579
  • 1
  • 4
  • 10