python remove vowels from list of strings
Python[Edit]
+
0
-
0
python remove vowels from list of strings
1 2 3 4 5 6 7 8 9 10 11 12 13import re def remove_vowels(string): return re.sub(r'[aeiouy]', '', string, flags=re.IGNORECASE) # Usage example: words = ['red', 'apple', 'dog'] result = map(lambda item: remove_vowels(item), words) print(list(result)) # ['rd', 'ppl', 'dg']
[Edit]
+
0
-
0
python remove vowels from list of strings
1 2 3 4 5 6import re words = ['red', 'apple', 'dog'] result = map(lambda item: re.sub(r'[aeiouy]', '', item, flags=re.IGNORECASE), words) print(list(result)) # ['rd', 'ppl', 'dg']