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