-2

how can i create a number of values between 1000 and 1500 with each value having a difference of 0.0299

Walker
  • 19
  • 3

3 Answers3

1

The best way is to use the numpy library:

import numpy as np
your_range = np.arange(1000, 1500, 0.0299)
Jock
  • 388
  • 2
  • 12
0

You need to use floats to achieve this. Try this:

i = 1000
while i >= 1000.00 and i <= 1500.00:
    i += 0.0299
    print(i)
LiiVion
  • 312
  • 1
  • 10
0
l = list(range(1000*10000, 1500*10000, int(0.0299*10000)))
l = [i/10000 for i in l]

print(l[0:10])
#[1000.0, 1000.0299, 1000.0598, 1000.0897, 1000.1196,.........
Ritwick Jha
  • 340
  • 2
  • 10