Link to home
Start Free TrialLog in
Avatar of Maria Qureshi
Maria Qureshi

asked on

what is wrong with this recursive code?

n=3

def countdown (n):
    if n <= 0:
        print ('Blastoff!')
    else:
        print (n)
        countdown (n-1)

when I press shift + enter I get a blank answer
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Maria Qureshi
Maria Qureshi

ASKER

That works! Instead of n = 3 I need to define the countdown function.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Norie (https:#a42329010)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

suhasbharadwaj
Experts-Exchange Cleanup Volunteer