Skip to content

Commit c3963e1

Browse files
Merge pull request #1492 from asheeeshh/patch-5
Renamed to python file and some refactoring
2 parents 745e773 + fcbffdc commit c3963e1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Python program to copy or clone a list
22
# Using the Slice Operator
33
def Cloning(li1):
4-
li_copy = li1[:]
5-
return li_copy
4+
return li1[:]
65

76
# Driver Code
8-
li1 = [4, 8, 2, 10, 15, 18]
7+
li1 = [
8+
4,
9+
8,
10+
2,
11+
10,
12+
15,
13+
18
14+
]
915
li2 = Cloning(li1)
1016
print("Original List:", li1)
1117
print("After Cloning:", li2)

0 commit comments

Comments
 (0)