Level 9 : What will be the output of the following code snippet?


x = 3
y = 1 
print(x, y)
x, y = y, x 
print(x, y)

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