Level 7 : What is the output of the below code?


list1 = [1,3,4]
list2 = list1
list2.append(2)
print(list1)

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