How to make a copy of the list in Python

You can make a copy of the list in Python by following the given step. If you want to learn Python then I will highly recommend you to read This Book.

How to make a copy of the list in Python
How to make a copy of the list in Python

Step 1

Copy Method is used to make a copy of the list in Python. In the given example, ‘a’ is the variable in which list is store. To make a copy of this list, I make a new variable ‘b’ and use a copy method of list.

a = [1,2,3,4,5,6,7,8,9,10]
print(a)
b = a.copy()
print(b)

People are also reading:

What is Computer Vision? Examples, Applications, Techniques

Top 10 Python Books | Best Python Books

Top 10 Computer Vision Books

Leave a Comment

Your email address will not be published.