Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8
This is because when you use the equal operator, you're copying the pointer to the same object. This is a deep copy. y=x[:] creates a shallow copy.
16th Mar 2019, 3:28 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar