day1/exercise/linspace.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Wed, 28 Oct 2009 20:32:52 +0530
changeset 250 760d5679834e
parent 64 333092b68926
permissions -rw-r--r--
Fixed typos and hanging words in Session 1 day 2.

def linspace(a, b, N):
    lns = []
    step = (float(b) - float(a)) / float(N - 1)
    print step
    for i in range(N):
        lns.append(a + i*step)

    return lns

print linspace(0, 5, 11)