# Define a list
numbers = [1, 2, 3, 4, 5]
# i. Addition operation
# Append an element to the end of the list
numbers.append(6)
print("List after addition:", numbers) # Output: [1, 2, 3, 4, 5, 6]
# ii. Insertion operation
# Insert an element at a specific position
numbers.insert(2, 10) # Insert 10 at index 2
print("List after insertion:", numbers) # Output: [1, 2, 10, 3, 4, 5, 6]
# iii. Slicing operation
# Extract a sublist using slicing
sublist = numbers[1:4] # Slice from index 1 to 3 (exclusive)
print("Sublist:", sublist) # Output: [2, 10, 3]
# Modify an element using slicing
numbers[3:5] = [8, 9] # Replace elements at index 3 and 4
print("Modified list:", numbers) # Output: [1, 2, 10, 8, 9, 6]