I needed to make a program that iterates over values from x1 to x2 in dx increments. But I can't figure out how it works
a = 1
while a < 2:
print(a)
a += 0.1
I got this result.
1
1.1
1.2000000000000002
1.3000000000000003
1.4000000000000004
1.5000000000000004
1.6000000000000005
1.7000000000000006
1.8000000000000007
1.9000000000000008
but wanted to get this result.
1
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9