Level 5 : What will be the output of the following code snippet?


def countdown(n):
    if n <= 0:
        print("Done!")
    else:
        print(n)
        countdown(n - 1)

countdown(3)

Author: SandhyaR | Tags: recursion | 1736+ Python FAQs | Share
frozenset | object-attribute | docstring | variable | higher-order-function | lambda | application | dicts | generators-in-python | call | function-and-scope | mutable | staticmethod | generators | precedence | functional-programming | pep | integer | objects | attribute | bitwise-operator | syntax | sum-function | iterable | binary-operation | input-function | default-mutable-argument | turtle | comprehension | pseudocode | operator | collection | round | bitwise-operator | identity-operator | overflow | virtual-environment | methods | int | zip | indentation | fabs-function | regex | tuple | logical-operator | oop | class-and-instance-variable | inheritance | arithmetic-operation | built-in | string-method | virtual-environment | syntaxerror | async | postfix | logical-operator | update | file | function-argument | control-flow | formal-and-actual-parameter | yield | nested-loop | init | escape-operator | matrix-list-comprehension | sorting | touples | stack | identifier | expression | operators | software-design | map-function | raise | conditional-statement | descriptors | random | mathematics | zfill-function | set-operation | access-modifier | boolean | immutable-data-type | factorial-function | loops | datetime | sorted | random-function | range | design-principle | head-and-tail | implementation | boolean-and-non-boolean | polymorphism | list-mutation | string-iteration | thread | lambdas | condition | pandas | control-statement | method | mapping-function | conversion | odd-number | string-formatting | set | immutability | multithreading | parameter | expand-tab | classes | type-conversion | control-flow | invalid-list | filter-function | counter | datatype | append | error | data-structures | conditional-statement | string-slicing | floating-point-precision | destructor | precedence-and-associativity | enumerate() | center | operator-and | print-statement | deep-copy | indexing | keyword | static-method | shallow-copy | while-else-loop | split | typeerror | mysql | with-statement | exception | data-type | python-django | string-manipulation | list-indexing | goto-function | string-concatenation | copy | python-history | operator-or | data-type | error-handling | list-vs-tuple | built-in-function | python_version | list-join | input | context-manager | heap-memory | type_conversion | syntax-error | print | asyncio | encoding | matplotlib | round-function | array | for | functions | def | version | asyncio-module | namedtuple | collections | choice | slicing | sys-module | operand | zip-function | __init_subclass__ | numeric | generator | logical-operation | regular-expression | class-and-inheritance | arithmetic-expression | sum() | oops | binary | list-operation | list-slicing | function | multiple-inheritance | assignment-operator | min-max-function | global | import-method | namespace | decorator | recursion | exception-handling | global-keyword | __all__-attribute | module | threading | list-comprehension | return-statement | lambda-function | max-min | string | multiprocessing | type-conversion | __future__ | format | exception-handling | rollback | interpreter | slice | encapsulation | class | identity-operator | class-and-object | loop-control | dictionary | file-handling | while-and-for-loop | constructor | counter-function | math-copysign | lists | data-structure | mathematical-function | command-line-parsing | join | string-slicing | name-mangling | complex-number | python-repl | file-handling | version-check | complex | input-function | gil | installation | python | inherit | statement | python-module | pickling-&-unpickling | debugging | memory-management | iterator | comment | matrix | string-formatting | operations | exponentiation | match | global-variable | syntax-error | id-function | library | comparison | feature | basic | numpy | data_structure | dictionaries | global-variable | bitwise | swapping | while-loop | decimal | package-management | benefit | assert | operator-overloading | magic-method | recurssion | data-structure | string-method | filter | built-in-function | list-method | tuple-unpacking | memory | list-comprehension | list | compute | min-function | file_handling | scientific-notation | else-statement | sys | loop | math ...