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