Python
# Program to clone a list
items = input("Enter list elements separated by space: ").split()
clone1 = items[:]
clone2 = list(items)
print("Original:", items)
print("Clone1:", clone1)
print("Clone2:", clone2)Output
Enter list elements separated by space: a b c Original: ['a', 'b', 'c'] Clone1: ['a', 'b', 'c'] Clone2: ['a', 'b', 'c']
We demonstrate two common shallow-copy techniques: slicing and passing to list().