day1/exercise/linspace.py
author Shantanu <shantanu@fossee.in>
Mon, 04 Jan 2010 19:02:28 +0530
changeset 336 f2c89f9af85f
parent 64 333092b68926
permissions -rw-r--r--
Added changes to exercise session of day1.

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)