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