I wrote this for python code and got an unexpected output. The output was a number of zeros then it said "restarting kernel". Why is the kernel restarting?
def countdown(n):
for n in range(0,5):
print(n)
countdown(n-1)
countdown(2)
On the other hand, I tried with if and there was no problem:
def countdown(n):
if n == 0:
print("blast of")
else:
print(n)
countdown(n-1)
countdown(5)
So why is it not working with for?