define a function called anti_vowel that takes one string,text ,as input and returns the text with all of the vowels removed.
Make sure to remove lowercase and uppercase vowels.
Hint:
to check to see if c is a vowel,you can do: c in "aeiouAEIOU"
def anti_vowel(text):
new_text = ""
for w in text:
if w not in "aeiouAEIOU":
new_text += w
return new_text
def anti_vowel(text):
for p in "aeiouAEIOU":
text = text.replace(p,"")
return text
第二种没学过,是在问答里找到的