Level 10 : What is the difference between a shallow copy and a deep copy in Python?

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