Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Practice

Instruction

Incredible! Let's make use of the function we created!

Exercise

Write a function called consonant_vowels_count(frequencies_dictionary, vowels) that will take a dictionary whose keys are letters and values are their frequencies (a dictionary similar to a dictionary returned from the function from the previous exercise), and a list of vowels as arguments. The function should print the total number of consonants and the total number of vowels in the following format:

VOWELS: <vowels>
CONSONANTS: <consonants>

For example, for input:

frequencies_dictionary = {'a': 2, 's': 1, 'i': 3, 'u': 3, 'm': 4, 'l': 2, 'z': 1, 'n': 3, 'k': 1, 'e': 4, 'y': 2, 'd': 2, 'o': 1}

the output should be:

VOWELS: 13
CONSONANTS: 16

Stuck? Here's a hint!

In order to iterate over both keys and values of a given dictionary, you have to use the .items() function:

for key, value in dictionary.items():
  ...