我正在尝试删除字符串中元音的出现次数,除非它们是单词开头。所以例如输入
"The boy is about to win"
应该输出 Th by is abt t wn
。这是我目前的代码。任何帮助都将不胜感激!def short(s):
vowels = ('a', 'e', 'i', 'o', 'u')
noVowel= s
toLower = s.lower()
for i in toLower.split():
if i[0] not in vowels:
noVowel = noVowel.replace(i, '')
return noVowel