#!/usr/bin/python def CYCLE(start, stop, step): var=[]; x=start; y=x; Astart=start; Bstop=stop; step=(abs(step) if step != 0 else 0.1); start=(Astart if start > stop and step < 0 else start); if (start > stop): x=Bstop; y=x; stop=Astart; if y+step <= stop: while x < stop+step: x=(round(x, 14) if isinstance(x,float) else int(x)); if x <= stop: var.append(x); x=x+step; else: var=[start]; return(var); print CYCLE(1,1.00001,0.000000001); #put any number as starting (start), ending (stop) and incremental (step) steps to see the realiability of the function