diff --git a/Clonig_list.py b/Clonig_list.py new file mode 100644 index 0000000..6128e85 --- /dev/null +++ b/Clonig_list.py @@ -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))