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