Answer to Question #274787 in Python for Snave

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.


1
Expert's answer
2021-12-03T00:37:54-0500
def countup(n):



    if n>=0:



        print('Blastoff!')



    else:



        print(n)



        countup(n+1)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS