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