in lists there is this feature called ".copy()". However I am a bit confuse whether to use ".copy()" over "=" and vice versa since both act exactly the same. Here is an example:
friends = ["Tom", "holland", "Steves", "Jim", "Jimmy", "Boy"]
friends2 = friends.copy()
print(friends2)
print(friends)
and the result obtain is this:
['Tom', 'holland', 'Steves', 'Jim', 'Jimmy', 'Boy']
['Tom', 'holland', 'Steves', 'Jim', 'Jimmy', 'Boy']
and if you use "=" instead of ".copy()", you get the same result. Example:
friends = ["Tom", "holland", "Steves", "Jim", "Jimmy", "Boy"]
friends2 = friends
print(friends2)
print(friends)
you get the same result.
So is there any differences in the both keyword. If there is which one should I use in different situations.