Final answer:
The function remove_duplicates removes duplicate integers from a list, leaving the original list intact and returns a new list with unique elements only.
Step-by-step explanation:
To remove duplicate integers from a list, the function remove_duplicates can be defined. This function will create a new list with only the unique elements from the original list.
Here is a Python function that accomplishes this task:
def remove_duplicates(lst):
unique_elements = []
for element in lst:
if element not in unique_elements:
unique_elements.append(element)
return unique_elements
If we call remove_duplicates([1,2,2,5,5,5,7]), it will return [1,2,5,7], as expected. The original list will remain unchanged.