day1/exercise/linspace.py
author Puneeth Chaganti <punchagan@fossee.in>
Thu, 05 Nov 2009 14:56:52 +0530
changeset 279 e7ce6f9d7e15
parent 64 333092b68926
permissions -rw-r--r--
Added Striding in session4.

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)