def countdown (n):
If n<=0:
print('Blastoff!')
else:
print(n)
countdown(n-1)
Write a new recursive function countup that expects a negative argument and counts "up" from that number.
def countup(n):
if n>=0:
print('Blastoff!')
else:
print(n)
countup(n+1)
Comments
Leave a comment