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