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