Me thinks range is for integers. One could use the generated integers to compute a decimal though.
No Expert I, Tom Merrick Jose Guevarra wrote: > > Hi, > > I was just trying to make a simple range function that works w/ decimal > numbers instead of just integers. Im new to python and I don't know if > one already exists, but that's besides the point. > > Im following the examples and syntax that Ive seen but it keeps coming > up w/ a "name error". It runs fine w/ not defined as a function > > Here's the script > ------------------------------ > > #! /bin/python > > a = frange(0, 13.45, 1.5) > print a > > def frange(xo, xn, incrmt): > b = [] > sum = xo > > while(sum < xn): > sum = sum + incrmt > b.append(sum) > > > return b > > --------------------------------- > > what's the problem here? > thanx > > _______________________________________________ > ActivePython mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ ActivePython mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs