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


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

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