Skip to content

Commit

Permalink
Renamed to python file and some refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
asrvd authored Mar 10, 2022
1 parent f5047c2 commit fcbffdc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cloning a list → cloning_a_list.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Python program to copy or clone a list
# Using the Slice Operator
def Cloning(li1):
li_copy = li1[:]
return li_copy
return li1[:]

# Driver Code
li1 = [4, 8, 2, 10, 15, 18]
li1 = [
4,
8,
2,
10,
15,
18
]
li2 = Cloning(li1)
print("Original List:", li1)
print("After Cloning:", li2)

0 comments on commit fcbffdc

Please sign in to comment.