i am trying to delete duplicate words from python, everything works, but "Kate" word is still duplicated. help me
def custom_function(list):
sia = []
for item in list:
sia.append(item.capitalize())
for word in sia:
while sia.count(word) != 1:
sia.remove(word)
if sia.count(word) == 1:
break
return sia
unknown_list = ["toby", "James", "kate", "George", "James", "rick", "Alex",
"Jein", "Alex", "Alex","George", "Jein", "kate", "medelin"]
print(custom_function(unknown_list))