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