Table of contents
3. Using the slicing technique
"""
Original List ---> l_0 : list_0
After Cloning :
l_1 : list_1
l_2 : list_2
l_3 : list_3
l_4 : list_4
l_5 : list_5
l_6 : list_6
"""
l_0 = [1,2,3,4,5,6,7,8,9,10]
print(f'list_0: {l_0}')
1. Using = operators
l_1 = l_0
print(f'list_1: {l_1}')
2. Using the copy() method
l_2 = l_0.copy()
print(f'list_2: {l_2}')
3. Using the slicing technique
l_3 = l_0[:]
print(f'list_3: {l_3}')
4. Using the extend() method
l_4 = []
l_4.extend(l_0)
print(f'list_4: {l_4}')
5. Using the append() method
l_5a = []
for i in range(len(l_0)): l_5a.append(l_0[i])
print(f'list_5a: {l_5a}')
l_5b = []
for j in l_0: l_5b.append(j)
print(f'list_5b: {l_5b}')
6. Using list comprehension
l_6 = [k for k in l_0]
print(f'list_6: {l_6}')