string = input("Enter any string: ")
if string == 'x':
exit();
else:
newstr = string;
print("
Removing 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);
# 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
import re
s = "Insert your string here"
# this will look to upper- AND lower-case vowels
# this is equivalent to re.sub("[aeiouAEIOU]", "", s)
re.sub("[AEIOU]", "", s, re.IGNORECASE)
>> "nsrt yr strng hr"
def anti_vowel(text):
new_text = ""
for i in text:
if i == 'a' or i == 'A':
pass
elif i == 'e' or i == 'E':
pass
elif i == 'I' or i == 'i':
pass
elif i == 'o' or i == 'O':
pass
elif i == 'u' or i == 'U':
pass
else:
new_text = new_text + i
return new_text
print anti_vowel('Hey look Words!')
class Vowels(object):
def __init__(self, vowelList):
self.vowelList = vowelList
lettersList = self.vowelList.s.split(",")
self.vowelList = [letter for letter in self.lettersList if letter in 'aeiou']