solutions

Sets

Given a list, remove the duplicates from it, noting that a set always has unique elements. Be sure to return a list as the function's output.

remove_duplicates([5, 6, 1, 1, 1, 7, 7, 2, 6, 5]) #[5,6,1,7,2]

Test Cases

test remove duplicates with occurrences - Run Test

def test_remove_duplicates_with_occurrences():
    assert remove_duplicates([1, 1, 1, 1, 1, 3, 4, 5, 5, 5]) == [1, 3, 4, 5]