Hey @Amal2,
It seems that you have only the range for second loop as incorrect. Let’s see how we can debug this. Try to run the below piece of code in a new jupyter cell that you can easily create in your notebook
m = 5
for i in range(m-1, -1, -1):
print(i)
for i in range(m-1, 0, -1):
print(i)
Try to see the difference between the outputs of the 2 for
loops, and understand why the difference matters. Let me know if this helps.
P.S. - Posting code publicly is strictly against the community guidelines. Please refrain from doing so in the future.
Cheers,
Elemento