We're a place where coders share, stay up-to-date and grow their careers.
You can also use copy.copy() and copy.deepcopy().
copy.copy()
copy.deepcopy()
Yeah, I was thinking about that. newlist = oldlist.copy()
newlist = oldlist.copy()
copy is a module where copy is a function not a method.
copy
list objects have a .copy method.
Yeah but I meant my how my example works. 😅
You can also use
copy.copy()
andcopy.deepcopy()
.Yeah, I was thinking about that.
newlist = oldlist.copy()
copy
is a module wherecopy
is a function not a method.list objects have a .copy method.
Yeah but I meant my how my example works. 😅