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