---
title: "Discussion on \"Python Assignment vs Shallow Copy vs Deep Copy (copy vs deepcopy): Differences, Nested Lists and When to Use Each (Tested Examples)\" | Hashnode"
description: "Discussion on \"Python Assignment vs Shallow Copy vs Deep Copy (copy vs deepcopy): Differences, Nested Lists and When to Use Each (Tested Examples)\". In Python, b = a does not copy anything: it gives the same object a second name, so a change through one name shows up in the other. A shallow copy (a.copy(), a[:], list(a), dict(a) or copy.copy(a)) c"
url: "https://hashnode.com/posts/python-copy-vs-deepcopy-vs-assignment/6af1fa3c77ad55ff696e98f6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Python Assignment vs Shallow Copy vs Deep Copy (copy vs deepcopy): Differences, Nested Lists and When to Use Each (Tested Examples)](https://mfaysaldev.hashnode.dev/python-copy-vs-deepcopy-vs-assignment?utm_source=hashnode&utm_medium=feed)

In Python, b = a does not copy anything: it gives the same object a second name, so a change through one name shows up in the other. A shallow copy (a.copy(), a\[:\], list(a), dict(a) or copy.copy(a)) c

18h ago · 16 min read · mfaysaldev.hashnode.dev  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#beginners](https://hashnode.com/tag/beginners)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#programming-ciovqvfcb008mb253jrczo9ye](https://hashnode.com/tag/programming-ciovqvfcb008mb253jrczo9ye)

## Written by

[Mahir Faysal](https://hashnode.com/@mfaysaldev)

@mfaysaldev

  
[View profile](https://hashnode.com/@mfaysaldev)

Student web developer — PHP, JavaScript, Next.js

I write practical coding tutorials at https://mfaysal.com | Learning cybersecurity on TryHackMe: https://tryhackme.com/p/mfaysal.dev

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
