count = lambda x: 0 if not x.isalpha() else sum(x.count(y) for y in set(x) if y in "aeiouAEIOU")
import redef count(text: str) -> int:pattern = r"[aeiouyAEIOUY]"# Find all vowel matches in the string/textmatches = re.findall(pattern, text)# Return the number of vowelsreturn len(matches)- count = lambda x: 0 if not x.isalpha() else sum(x.count(y) for y in set(x) if y in "aeiouAEIOU")
Funny problem