Skip to content

e12b1_most_repeated_vowels.py gives IndexError if word has no vowels #19

Description

@godamockute

My suggestion:

def most_repeating_vowel_count(word):
    vowels = 'aieouAIEOU'
    vowel_dict = Counter({letter: count for letter, count in Counter(word).items() if letter in vowels})
    if not vowel_dict:  # if there are no vowels in the word
        return 0
    else:
        return vowel_dict.most_common(1)[0][1]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions