How to Remove Duplicate Elements in List using Python

preview_player
Показать описание
In this video i will show you how to remove duplicate elements from a list using while loop in python

my setup and gadgets

some terms related to this video
remove duplicates in list python
remove duplicates in linked list python
how to remove duplicate elements in list python
python list tutorial
python list operations
remove duplicate elements from a list in python

tags: #python_list #i_know_python
Рекомендации по теме
Комментарии
Автор

a = [1, 2, 3, 3, 4]
print(a)
a = list(set(a))
print(a)
# O(1) algorithm for the same task.
# The set() function converts a to a set which, in turn, cannot have duplicates and returns the set without the duplicates, then the list function converts the set back to a list and returns it.

PedroCarneiroJr
Автор

That was fast and simple and super useful. thank you

ronzmartorres
Автор

This was a very great explanation.Thank you!

iyvonneanne
Автор

Thanks, I feel happy because this video help me a lot, I'm from Egypt and I really thank you sir ❤️🌟

مجردرأي-صل
Автор

good lesson. thank you very much. I could understand much better the duplicate value program which is explained in this video. because it was difficult to understand in my class to me.

daytoday
Автор

Apne to ankhe khol di... Ye adbhud tarika btake... Kaha se ate hai aise log...

CodingLovers_
Автор

Thank you sir, you've answered by assignment

jrkagame
Автор

result = list(set(list1))

much faster

scemamil
Автор

How we should take only unique values like output is 9, 8995

shireeshapuli
Автор

sir can we use list comprehension in code ?

pavansaichintala
Автор

I think result=[] is also not required in this program.

abhiankur
Автор

Can u help me plz i want calculate the no. Of duplicate as 1
I mean if a column contains 1, 1 2, 3, 4, 4, 5
So total no. Of column shoulde be 5

sakshideo
Автор

Lmao i sort it first then check it one by one and append to new list. Thx man i think i should learn more

dharmawangsa
Автор

Hello,
if you can tell the program, where I have to take input from the user.

Thanks

lavisharora
Автор

import re
def remove_duplicate_ok(text):

pattern = r'\bOK\b\s+\bOK\b'

return re.sub(pattern, 'OK', text, flags=re.IGNORECASE)

result =
print(result)

deghedy