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