Python Tutorial Python Advanced Python References Python Libraries

Python List - copy() Method



The Python copy() method is used to copy the entire list into a new list.

Syntax

list.copy()

Parameters

No parameter is required.

Return Value

Returns a copy of the specified list.

Example:

In the example below, list copy() method is used to copy the list called MyList into the list called NewList.

MyList = ['Red', 'Blue', 'Green']
NewList = MyList.copy()
print(NewList)

The output of the above code will be:

['Red', 'Blue', 'Green'] 

❮ Python List Methods