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