Level 10 : Output of this code?


lst = [[0]*3]*3
lst[0][0] = 1
print(lst)

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