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