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