# 3. List Remove Duplicates

**URL:** <https://forum.codewithmosh.com/t/3-list-remove-duplicates/28540>\
**Category:** Python\
**Created:** [September 4, 2024, 4:59pm UTC](https://forum.codewithmosh.com/t/3-list-remove-duplicates/28540 "2024-09-04T16:59:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinhu](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@kevinhu](https://forum.codewithmosh.com/u/kevinhu)\
**Post date:** [September 4, 2024, 4:59pm UTC](https://forum.codewithmosh.com/t/3-list-remove-duplicates/28540/1 "2024-09-04T16:59:41Z")

</div>

A function that removes duplicates from a list. For example, given the list [1, 2, 2, 3, 4, 4, 5], the function should return [1, 2, 3, 4, 5].

![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/a/a5424d95579681c4dffdbaddb0605d3c06696fb9.png)

---

<div class="post-metadata">

**Author:** ![nithya](https://avatars.discourse-cdn.com/v4/letter/n/df788c/32.png) [@nithya](https://forum.codewithmosh.com/u/nithya)\
**Post date:** [January 7, 2025, 2:35pm UTC](https://forum.codewithmosh.com/t/3-list-remove-duplicates/28540/2 "2025-01-07T14:35:52Z")

</div>

Another way to remove duplicate list

```auto
def remove_duplicate_list(duplicate_list = []):
    for i in range(len(duplicate_list) - 1, 0, -1):
        for j in range(0, i):
            if duplicate_list[j] == duplicate_list[i]:
                duplicate_list.pop(i)
                break
    return duplicate_list

```

---

<div class="post-metadata">

**Author:** ![nagpalma](https://avatars.discourse-cdn.com/v4/letter/n/cab0a1/32.png) [@nagpalma](https://forum.codewithmosh.com/u/nagpalma)\
**Post date:** [October 5, 2025, 8:06pm UTC](https://forum.codewithmosh.com/t/3-list-remove-duplicates/28540/3 "2025-10-05T20:06:53Z")

</div>

Another way:

```auto
def remove_duplicates(l):
    uniques = []
    for item in l:
        if item not in uniques:
            uniques.append(item)
    return uniques

```
