i know that my will seem trivial,but i cant figure out why isn't 'stop' equal to zero, since 'start' value is already overwritten.But when i simulate the same scenario out of the function it does indeed overwrite it.Am i missing something here?
def interval(start, stop =None, step = 1 ):
'Imitates range() for step >0 '
if stop is None:
start, stop = 0, start #since start is already 0, why isn't stop as well?
print start,stop , step
result = []
i = start
while i< stop:
result.append(i)
i+=step
return result