Level 10 : What will be the output of the following Python code?


>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)

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