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