Beispiel #1
0
def func():
    lower = TEXT.lower()
    return {
        'vovels': Counter(c for c in lower if c in VOVELS),
        'consonants': Counter(c for c in lower if c in CONSONANTS)
    }
    return result
Beispiel #2
0
def func():
    result = {
        'vowels': defaultdict(int),
        'consonants': defaultdict(int),
    }
    for l in TEXT.lower():
        if l in VOVELS: result['vowels'][l] += 1
        if l in CONSONANTS: result['consonants'][l] += 1
    return result
Beispiel #3
0
def func():
    lower = TEXT.lower()
    return {
        'vovels': Counter(c for c in lower if c in 'aeiou'),
        'consonants': Counter(c for c in lower if c in 'bcdfghjklmnpqrstvwxyz')
    }
    # result['vowels'] = Counter(c for c in lower if c in 'aeiou')
    # result['consonants'] = Counter(c for c in lower if c in 'bcdfghjklmnpqrstvwxyz')
    return result
def func():
    result = {
        'vowels': {},
        'consonants': {},
    }
    lower = TEXT.lower()
    char_set = set(lower)
    for l in char_set:
        if l in VOVELS: result['vowels'][l] = lower.count(l)
        if l in CONSONANTS: result['consonants'][l] = lower.count(l)
    return result
Beispiel #5
0
def func():
    result = {'vowels': {}, 'consonants': {}}
    for l in TEXT.lower():
        if l in 'aeiou':
            if l not in result['vowels']:
                result['vowels'][l] = 1
            else:
                result['vowels'][l] += 1
        if l in 'bcdfghjklmnpqrstvwxyz':
            if l not in result['consonants'].keys():
                result['consonants'][l] = 1
            else:
                result['consonants'][l] += 1
    return result
Beispiel #6
0
def func():
    result = {}
    result['vowels'] = dict(Counter(c for c in TEXT.lower() if c in VOVELS))
    result['consonants'] = dict(
        Counter(c for c in TEXT.lower() if c in CONSONANTS))
    return result
Beispiel #7
0
def func():
    result = {}
    result['vowels'] = dict(Counter(c for c in TEXT.lower() if c in 'aeiou'))
    result['consonants'] = dict(
        Counter(c for c in TEXT.lower() if c in 'bcdfghjklmnpqrstvwxyz'))
    return result