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