📜  如何在python代码示例中从字符串中删除元音

📅  最后修改于: 2022-03-11 14:45:12.373000             🧑  作者: Mango

代码示例3
# removing vowels in a string
def anti_vowel(c):
    newstr = c
    vowels = ('a', 'e', 'i', 'o', 'u')
    for x in c.lower():
        if x in vowels:
            newstr = newstr.replace(x,"")

    return newstr