Level 10 : What does this output?


lst = [1, 2, 3]
lst = [[x for x in lst] for _ in range(3)]
lst[1][2] = 99
print(lst)

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