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