Answers for "python code filter vowels from a string"

1

python method to filter 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
Posted by: Guest on November-03-2020
0

how to remove vowels from a string in python

string = input("Enter any string: ")
if string == 'x':
    exit();
else:
    newstr = string;
    print("\nRemoving vowels from the given string");
    vowels = ('a', 'e', 'i', 'o', 'u');
    for x in string.lower():
        if x in vowels:
            newstr = newstr.replace(x,"");
    print("New string after successfully removed all the vowels:");
    print(newstr);
Posted by: Guest on August-12-2021

Code answers related to "python code filter vowels from a string"

Python Answers by Framework

Browse Popular Code Answers by Language