Im having difficulties completing my code and executing it, can someone help?
Write a function called remove_duplicates that accepts as a parameter a sorted list of strings and returns a new list excluding duplicates from the original list. For example, if the list stores the values ['be', 'be', 'is', 'not', 'or', 'question', 'that', 'the', 'to', 'to'] , the function should return the list with the values ['be', 'is', 'not', 'or', 'question', 'that', 'the', 'to'] . Because the values will be sorted, all of the duplicates will be grouped together. Assume that the list contains only string values, but keep in mind that it might be empty. My code: https://code.sololearn.com/c08BY9CEA8hS/#py a = '' dup_items = set() uniq_items = [] for x in a: if x not in dup_items: uniq_items.append(x) dup_items.add(x) print("original list:", a) print("list after removing duplicates:", dup_items) Output: original list: ['be', 'be', 'is', 'not', 'or', 'question', 'that', 'the', 'to', 'to'] list after removing duplicates: ['be', 'is', 'not', 'or', 'question', 'that', 'the', 'to']