# Demonstrating Built-in List Methods in Python
def list_methods_demo():
my_list = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3]
print("Original List:", my_list)
# Append - Adds an element to the end
my_list.append(7)
print("After append(7):", my_list)
# Insert - Inserts an element at a specific index
my_list.insert(2, 8)
print("After insert(2, 8):", my_list)
# Remove - Removes the first occurrence of a value
my_list.remove(1)
print("After remove(1):", my_list)
# Pop - Removes and returns the last element
popped_element = my_list.pop()
print("After pop():", my_list, "(Popped Element:", popped_element, ")")
# Sort - Sorts the list in ascending order
my_list.sort()
print("After sort():", my_list)
# Reverse - Reverses the list
my_list.reverse()
print("After reverse():", my_list)
# Index - Finds the first occurrence of a value
index_of_five = my_list.index(5)
print("Index of 5:", index_of_five)
# Count - Counts occurrences of a value
count_of_five = my_list.count(5)
print("Count of 5:", count_of_five)
# Copy - Creates a shallow copy of the list
copied_list = my_list.copy()
print("Copied List:", copied_list)
# Clear - Removes all elements from the list
my_list.clear()
print("After clear():", my_list)
# Run the demonstration
list_methods_demo()