day1/exercise/linspace.py
changeset 64 333092b68926
equal deleted inserted replaced
63:f5eac04a00fe 64:333092b68926
       
     1 def linspace(a, b, N):
       
     2     lns = []
       
     3     step = (float(b) - float(a)) / float(N - 1)
       
     4     print step
       
     5     for i in range(N):
       
     6         lns.append(a + i*step)
       
     7 
       
     8     return lns
       
     9 
       
    10 print linspace(0, 5, 11)