试试这个:
def rem_vowel(string): vowels = ('a', 'e', 'i', 'o', 'u') for x in string.lower(): if x in vowels: string = string.replace(x, "") print(string) string = "This website is for losers LOL!" rem_vowel(string)