Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions Clonig_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

# Approach 1:

def Cloning_List(Given_List):
Result = Given_List[:]
return Result


Given_List = [4, 5, 7, 8, 9, 6, 10, 15]
print(Cloning_List(Given_List))

# Approach 2:


def Cloning_List(Given_List):
Result = []
Result.extend(Given_List)
return Result


Given_List = [4, 5, 7, 8, 9, 6, 10, 15]
print(Cloning_List(Given_List))

# Approach 3:


def Cloning_List(Given_List):
Result = list(Given_List)
return Result


Given_List = [4, 5, 7, 8, 9, 6, 10, 15]
print(Cloning_List(Given_List))

# Approach 4:


def Cloning_List(Given_List):
Result = Given_List
return Result


Given_List = [4, 5, 7, 8, 9, 6, 10, 15]
print(Cloning_List(Given_List))