Question #274787

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.


Expert's answer

def countup(n):



    if n>=0:



        print('Blastoff!')



    else:



        print(n)



        countup(n+1)
LATEST TUTORIALS
APPROVED BY CLIENTS