chirag maliwal <chiragmaliwal1...@gmail.com> added the comment:

a = [0, 1, 2, 3, 4, 1, 2, 3, 5]

for i in a:
    if a.count(i) > 1:
        a.remove(i)

print(a)

"""
Output

[0, 4, 1, 2, 3, 5]
"""

It's working fine for the above code.
Yes I can use set for this but I tried with count and remove.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40809>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to