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


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

Author: PravallikaG | Tags: list | 1736+ Python FAQs | Share
with-statement | append | variable | precedence | touples | syntax | logical-operation | recursion | sys | nested-loop | while-else-loop | string-concatenation | math-copysign | global | collections | syntax-error | sorted | bitwise | arithmetic-expression | conditional-statement | parameter | raise | deep-copy | memory | name-mangling | virtual-environment | feature | version | python_version | exception-handling | for | multiple-inheritance | string-manipulation | polymorphism | list | scientific-notation | loop-control | typeerror | class | string-formatting | function | iterator | type-conversion | inheritance | software-design | input | python-repl | range | magic-method | attribute | pep | loop | lambda-function | classes | list-method | iterable | array | virtual-environment | lists | format | else-statement | immutable-data-type | complex-number | zip-function | floating-point-precision | method | assignment-operator | lambdas | boolean-and-non-boolean | benefit | asyncio | frozenset | filter-function | fabs-function | math | command-line-parsing | comment | complex | slice | precedence-and-associativity | functional-programming | binary-operation | input-function | list-comprehension | match | call | error | package-management | built-in-function | print-statement | immutability | data-type | set | operator-or | identity-operator | head-and-tail | design-principle | version-check | python-history | recurssion | indexing | data_structure | matplotlib | string | default-mutable-argument | destructor | data-structures | function-and-scope | string-slicing | python | gil | thread | constructor | random-function | copy | zfill-function | application | oop | staticmethod | stack | dicts | choice | factorial-function | static-method | list-indexing | invalid-list | string-method | functions | identity-operator | implementation | sum-function | generators-in-python | type-conversion | file | encoding | min-max-function | numeric | global-keyword | assert | namespace | swapping | map-function | yield | max-min | turtle | binary | operator-overloading | mathematics | context-manager | arithmetic-operation | zip | input-function | python-django | bitwise-operator | docstring | memory-management | datatype | sum() | init | loops | postfix | import-method | mutable | objects | pickling-&-unpickling | string-iteration | keyword | print | identifier | logical-operator | operator-and | escape-operator | id-function | list-comprehension | list-mutation | function-argument | mathematical-function | while-and-for-loop | python-module | comparison | sorting | __init_subclass__ | generator | pandas | counter | encapsulation | file-handling | collection | module | mapping-function | lambda | namedtuple | heap-memory | indentation | asyncio-module | regex | list-slicing | installation | generators | string-slicing | list-vs-tuple | matrix | error-handling | numpy | built-in-function | multiprocessing | center | debugging | operator | control-flow | goto-function | filter | return-statement | join | methods | int | interpreter | operand | syntaxerror | dictionary | global-variable | exponentiation | control-flow | statement | exception-handling | exception | rollback | min-function | overflow | data-structure | def | compute | basic | access-modifier | expression | decorator | class-and-object | condition | integer | odd-number | data-type | update | descriptors | conditional-statement | regular-expression | matrix-list-comprehension | conversion | pseudocode | multithreading | operators | object-attribute | comprehension | datetime | type_conversion | tuple | built-in | operations | library | __all__-attribute | sys-module | set-operation | slicing | __future__ | decimal | threading | shallow-copy | string-formatting | list-operation | inherit | while-loop | random | class-and-inheritance | round-function | tuple-unpacking | class-and-instance-variable | round | global-variable | syntax-error | mysql | string-method | file-handling | list-join | boolean | bitwise-operator | higher-order-function | control-statement | logical-operator | async | expand-tab | dictionaries | file_handling | formal-and-actual-parameter | data-structure | enumerate() | oops | split | counter-function ...