How to create a function "my range" In python which works same as built in range?
My attempt:
def myrange(end, start=1, step=1):
if step == 1:
print("(%s,%s)" % (start, end))
else:
print("(%s,%s,%s)" % (start, end, step))
b = myrange(10)
print(b)
But this does not work when I use for loop, please help how to create such user defined function.