Level 9 : What is the output of the following code?


def outer_fun(a, b):
    def inner_fun(c, d):
        return c + d
    return inner_fun(a, b)

res = outer_fun(10, 10)
print(res)

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