what is shallow copy and deep copy | copy() function python

preview_player
Показать описание
#shallowcopy #deepcopy #python
what is shallow copy and deep copy , we will discuss this topic and use python to demonstrate , we will see how to create deep and shallow copies, create deep copy of a list and and the difference as deep copy vs shallow copy.
in this demonstration we will use copy() function in python to create shallow and deep copies of objects .
In python you can't very simply use the = to copy something from one variable/object to another object. To truly copy something you need to make use of the shallow copy or deep copy.
copy() function in python returns a shallow copy of list while the deepcopy() function returns a deep copy of list.
Рекомендации по теме
Комментарии
Автор

Clears my doubt on shallow copy and deep copy

ramakdixit