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