Python 去重:从逗号分隔的英文人名列表中移除重复项
names = input().split(',') unique_names = [] for name in names: if name not in unique_names: unique_names.append(name) print(unique_names)
原文地址: https://www.cveoy.top/t/topic/orbv 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
names = input().split(',') unique_names = [] for name in names: if name not in unique_names: unique_names.append(name) print(unique_names)
原文地址: https://www.cveoy.top/t/topic/orbv 著作权归作者所有。请勿转载和采集!