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