Home / Python Tips Generated By ChatGPT / Using set for Unique Elements in Python Convert a list to a set to remove duplicate elements. Source Code my_list = [1, 2, 2, 3, 4, 4, 5] unique_items = set(my_list) print(unique_items)