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