因此,我有一个名称列表,我想检查此列表以查看是否有不包含元音的名称。如果有,我想将它们从当前列表中删除,并将它们放入无元音名称列表中。
答案 0 :(得分:0)
namesWithVowels = []
for name in names:
originalName = name
name = name.lower()
if ('a' in name or 'e' in name or 'i' in name or 'o' in name or 'u' in name):
namesWithVowels.append(originalName)
for name in namesWithVowels:
if name in names:
names.remove(name)