Function Details: copy_(list)

Description


Returns a shallow copy of the list.


Extended Description


The copy() method returns a new list containing a shallow copy of the original list. A shallow copy means the structure of the list is copied, but the elements are references to the same objects. For nested lists, only the references are copied, not the nested lists themselves.


Read More about copy_(list) from Python Documentation

Function Signature


list.copy() -> list

Module: builtins

Class: list

Parameters



Return


Returns a new list that is a shallow copy of the original.


Return Type


list

Output

Explanation

This example shows how copy() creates a new list with the same elements.