Abhay Parashar
May 11, 2021

--

The assignment operator in python does not copy the content of the list it just create a reference for the list.

here b is just a second name of a.

if you want to copy the list a to b then use b=a.copy() otherwise it will always creates a new variable with reference of a.

--

--

Abhay Parashar

Cyber Guy 🧑‍💻| Top Writer | 5M+ Views | Engineer | Learning and Sharing Knowledge Everyday | Python is ❤️| Editor of The Pythoneers