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