We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

Vowels

The anti-spam team at Fantasy Quest is doing text analysis on players' in-game chats.

Assignment

Complete the count_vowels function. It takes a string and returns:

  1. The total number of vowels in the string (count every occurrence, not just unique)
  2. A set of the unique vowels found in the string

We are only interested in the 5 vowels: a, e, i, o, u, and their capitalized versions. Treat uppercase and lowercase vowels as separate. For example, "A" and "a" are not the same.

Tips

  1. Create a set of the ten vowels (both lowercase and uppercase)
  2. Create a counter started at 0
  3. Create an empty set to store the unique vowels
  4. Iterate over the characters in the string, for example:
    for char in text:
        # do stuff
    
  5. If the character is in the set of vowels:
    • Increment the counter
    • Add the character to the set of unique vowels
  6. Return the counter and the set of unique vowels

New Empty Set

my_new_set = set()

New Set With Values

my_new_set = {"apple", "banana", "grape"}