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


def fun(n):
    if (n > 100):
        return n - 5
    return fun(fun(n+11));
 
print(fun(45))

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