Home >>Python List Methods >Python List copy() Method

Python List copy() Method

Python List copy() Method

Python list copy() method is used to return a copy of the specified given input list.

Syntax:
list.copy()
Here is an example of Python copy() method:

fruits = ["Abhi", "Alpha", "Jerry", "Bingo"]
x = fruits.copy()
print(x)

Output:
['Abhi', 'Alpha', 'Jerry', 'Bingo']
Example 2

fruits = ["Python", "Php", "Node"]
x = fruits.copy()
print(x)

Output:
['Python', 'Php', 'Node']

No Sidebar ads