I want to Print all the numbers between 5 to 8, with jumps of 0.3. I got 2 problems doing it:
It's not very accurate (I know the reason, what I dont know is how to get 5.89999999999 to become 5.9)
I dont know how to do it without any imports and functions (without numpy and without xrange which btw does not exist in python 3.x anymore as I understood)
This is just for a Homework question, I'm a new python learner, so I dont realy know ALL the tools and tricks of python.
max = 9
min = 5
step = 0.3
while min <= max:
min += step
print(min)
Expected:
5,
5.3,
5.6,
5.9,
6.2,
...
Actual reasults:
5.3,
5.6,
5.89999999995,
6.1999999999,
6.4999999999,
...