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