Level 9 : What will be the output?


a = [1, 2, 3]
b = a
a += [4, 5]
print(a, b)

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