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 13
import 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']