I'm trying two variants of the python range function with the primary objective of making the function inclusive. However neither seems to be working
def main():
for i in standard_range(1, 25, 1):
print(i, end='')
def inclusive_range(*args):
numargs = len(args)
if numargs < 1:
raise TypeError("Requires atleast one argument")
elif numargs == 1:
stop = args[0]
start = 0
step = 1
elif numargs == 2:
(start, stop) = args
step = 1
elif numargs == 3:
(start, stop, step) = args
else:
raise TypeError("Cannot have more than three arguments")
i = start
while i <= stop:
yield i
i += step
def standard_range(start, stop, step):
i = start
while i <= stop:
yield i
i += step
if __name__ == " __main__ ":
main()
Any help will be appreciated.