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


a = 3
b = 1 
print(a, b)
a, b = b, a 
print(a, b)

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