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