Level 9 : Which type of copy is shown in the following python code?


l1=[[10, 20], [30, 40], [50, 60]]
ls=list(l1)
ls
[[10, 20], [30, 40], [50, 60]]

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