ropering / Study

0 stars 0 forks source link

[Python] count_vowels #14

Open ropering opened 2 years ago

ropering commented 2 years ago
import re

def count_vowels(string):
    return len(len(re.findall(r'[aeiou]', string, re.IGNORECASE)))

count_vowels('foobar') # 3
count_vowels('gym') # 0