0

I am using Python-3.3.2. How can I use range()to achieve float type of step? Assume my code is:

for x in range(1.5,20,0.25):
    print(x)
Ryan Haining
  • 35,360
  • 15
  • 114
  • 174
Jianli Cheng
  • 371
  • 1
  • 8
  • 17
  • @IgnacioVazquez-Abrams I tried `import numpy as np`, but there I got an error – Jianli Cheng Sep 19 '13 at 02:19
  • You have to download numpy first. But check the other solutions - you can simply do `for x in range(6, 80): print x*0.25` without installing numpy. – flornquake Sep 19 '13 at 02:34

0 Answers0