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