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