Level 9 : Read the following Python code carefully and point out the global variables?


y, z = 1, 2
def f():
    global x
    x = y+z

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