Level 1 : What is the output of the below code?


def func(x):

    if(x==0 or x==1):

        return 1

    return func(x-1)*x

func(6)

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