Level 9 : What will be the output of the following code?


a = 3
b = 1 
print(a, b)
a, b = b, a 
print(a, b)

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