Skip to content

Commit 4f0ee0b

Browse files
Merge pull request seeditsolution#357 from yakshdeveloper/patch-1
Cloning or Copying a list
2 parents 20c8a39 + 9301520 commit 4f0ee0b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Cloning or Copying a list

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Python code to clone or copy a list
2+
# Using the in-built function list()
3+
def Cloning(li1):
4+
li_copy = list(li1)
5+
return li_copy
6+
7+
# Driver Code
8+
li1 = [4, 8, 2, 10, 15, 18]
9+
li2 = Cloning(li1)
10+
print("Original List:", li1)
11+
print("After Cloning:", li2)

0 commit comments

Comments
 (0)