期望结果:
>>> removeVowels('apple')
"ppl"
>>> removeVowels('Apple')
"ppl"
>>> removeVowels('Banana')
'Bnn'
代码(初学者):
def removeVowels(word):
vowels = ('a', 'e', 'i', 'o', 'u')
for c in word:
if c in vowels:
res = word.replace(c,"")
return res
如何同时使用小写和大写字母?