Level 9 : What is the output of the following code?


a=15
def func():
    a=20
    return
print('a=',a)

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