過濾列表中重複的字符

char_list = ['A','B','A','C','B','A']
new_list = []

for char in char_list:
    if char_list.count(char) == 1:
        new_list.append(char)
    if char_list.count(char) > 1 and char not in new_list:
        new_list.append(char)
    else:
        continue

print(new_list)
相關文章
相關標籤/搜索