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 | 1859+ Python FAQs | Share
file-handling | tuple-unpacking | datatype | else | data_structure | exception-handling | function-argument | data-structure | lambdas | comprehension | dataframe-and-series-objects | design-principle | dictionary-comprehensions | for | control-flow | file | __init_subclass__ | filter-function | file-handling | docstring | frozenset | generators-in-python | key-value-pairs | exponentiation | creating-custom-modules | deep-copy | data-structures-in-python | exception-handling | introduction-to-threads | access-modifier | expand-tab | syntaxerror | error-handling | sorting | benefit | reading:-read(),-readline(),-readlines() | parameter | operand | center | complex-number | namedtuple | global | pass | methods | arbitrary-arguments-(*args,-**kwargs) | enumerate() | file_handling | odd-number | round-function | matrix-list-comprehension | reading-and-writing-large-files-efficiently | logical-operation | escape-operator | swapping | list-mutation | functional-programming | bitwise-operator | min-function | data-structure | string-slicing | id-function | arithmetic-expression | range | overriding-methods | class-and-object | slicing | filtering-and-indexing | operations | heap-memory | set | list-method | built-in-modules | int | string-manipulation | join | gil | constructor | defining-functions | syntax-error | introduction-to-python | init | floats | membership-operators-(in,-not-in) | name-mangling | lambda-function | immutability | factorial-function | global-variable | string-methods | managing-directories-with-os-and-shutil | encoding | operator-and | sum-function | directory-operations | format | namespace | creating-and-starting-threads | stack | object-attribute | error-handling | exception | statement | software-design | feature | basic | binary-operation | string-formatting | boolean-masking | shallow-copy | package-management | python | collection | built-in-function | python-django | regex | context-manager | string-formatting | built-in | split | sys-module | error | operator-or | single-inheritance | syntax | introduction-to-multiprocessing | lambda-functions | sum() | encapsulation | indexing | command-line-parsing | loops | print-statement | assignment-operator | staticmethod | raise | sorting-and-ranking | regular-expressions | syntax-error | polymorphism | list-methods-and-slicing | reading-and-writing-files | advanced-file-operations | function | __all__-attribute | formal-and-actual-parameter | loop | complex | default-arguments | dictionary | sets | sorted | recurssion | input-function | sys | counter | conditional-statements | choice | python-syntax-and-structure | parsing-with-strptime | built-in-function | set-operation | string-concatenation | asyncio | dictionaries | conditional-statement | expression | def | string | while-loop | return-statement | pep | immutable-data-type | anchors-(^,-$) | virtual-environment | regular-expression | string-iteration | import-method | boolean | list-join | interpreter | control-flow | update | list-comprehension | with-statement | working-with-temporary-files-using-tempfile | default-mutable-argument | static-method | bitwise-operator | strings | functions | intering | string-method | integers | generators | literal-characters-and-special-characters | list-indexing | type-conversion-and-casting | class | mathematical-function | joining-and-merging-dataframes | mysql | destructor | asyncio-module | recursion | rollback | async | indexing:-loc-vs-iloc | filter | string-method | functional-programming | scientific-notation | list-operation | generator | operator-overloading | identifier | aggregating-data-with-functools.reduce() | global-keyword | pickling--unpickling | random | python_version | datetime | binary | test-discovery | dicts | formatting-with-strftime | multiple-inheritance | multiprocessing | inheritance | tuple-methods | assignment-operators | round | data-type | opening-files-(open()) | math | slice | floating-point-precision | list-slicing | boolean-and-non-boolean | python-history | oop | global-variable | iterable | counter-function | datetime.date,-datetime.time,-datetime.datetime | tuples | list-comprehension | class-and-instance-variable | debugging | goto-function | while-loops | python-operators | memory | multiple-inheritance | list-comprehensions | iterator | string-slicing | conversion | function-and-scope | min-max-function | mutable | overflow | using-os-and-pathlib-modules | fabs-function | iterators | version | module | tuple | touples | higher-order-function | call | random-function | input | arithmetic-operation | booleans | logical-operator | operators | postfix | time-series-with-pandas | control-statement | zip | logical-operators | raise-statement | precedence-and-associativity | why-use-multiprocessing-over-threading?-(gil) | type-conversion | type-conversion | append | indentation | walking-through-directories-using-os.walk() | threading | library | collections | method-overloading | lambda | nested-loop | thread-safe-data-structures-(queue.queue) | pandas | decorator | integer | class-decorators | loop-control | __future__ | head-and-tail | numeric | operator | comparison | inherit | magic-method | keyword | class-and-inheritance | yield | print | working-with-binary-files-(rb,-wb) | data-types | loop-control-statements | handling-missing-values-(fillna,-dropna) | type_conversion | using-assertions-(assertequal,-assertraises) | implementation | application | precedence | dictionary-methods | list | installation | mapping-function | compute | numpy | pseudocode | while-else-loop | logical-operator | attribute | oops | array | variable | identity-operator | using-map()-for-transformations | working-with-file-paths | working-with-dates-and-times | using-else-and-finally | quantifiers-(*,-+,-?,-{}) | using-join()-and-is_alive()-methods | typeerror | difference-between-threads-and-processes | objects | copy | match | matrix | max-min | using-lists-as-stacks | lists | python-module | comment | virtual-environment | zip-function | data-structures | assert | conditional-statement | classes | data-type-conversions | list-vs-tuple | memory-management | unit-testing | python-repl | list,-set,-and-dictionary-comprehensions | invalid-list | thread-synchronization | using-yield-in-functions | method | identity-operators-(is,-is-not) | identity-operator | condition | bitwise | descriptors | decimal | input-function | writing:-write(),-writelines() | matplotlib | multithreading | thread | data-type | else-statement | map-function | turtle | multiple-except-blocks | version-check | while-and-for-loop | mathematics | using-the-threading-module | math-copysign | zfill-function ...