how can i create a number of values between 1000 and 1500 with each value having a difference of 0.0299
            Asked
            
        
        
            Active
            
        
            Viewed 179 times
        
    3 Answers
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
- 
                    From the user question i think – Alessandro Togni Jun 21 '22 at 11:35
- 
                    the number is coming from "having a difference of 0.0299" – LiiVion Jun 21 '22 at 11:38
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
