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