Level 10 : What os the output of the following code?


a = [[]]*2
a[1].append(6)
print(a)

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