I tried to loop from 0.1 to 2.0 and then print the output to the console.. But I got strange output like these:
0.1 0.2 0.30000000000000004 0.4 0.5 0.6 0.7 0.7999
That's a bug (on your side).
Do not use floating point numbers until you learn what they are and how they work.
This is normal. It's inherent in floating point; numbers like 0.3 can't be stored as exact values in binary, so you get slowly accumulating errors. References: Python manual, Wikipedia, Technical explanation from Princeton CS.