Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def vowel_count(list_of_strings):
- """Returns a dictionary of vowel counts for the given list of strings.
- Args:
- list_of_strings: A list of strings.
- Returns:
- A dictionary, keyed on the five vowels a, e, i, o, and u. The value for each
- should be the total number of entries in the list which contain at least a
- single copy of that vowel.
- """
- vowel_counts = {}
- for vowel in ['a', 'e', 'i', 'o', 'u']:
- vowel_counts[vowel] = 0
- for string in list_of_strings:
- for vowel in ['a', 'e', 'i', 'o', 'u']:
- if vowel in string:
- vowel_counts[vowel] += 1
- return vowel_counts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement