

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Sets
incomplete
2: Sets Quiz
incomplete
3: Vowels
incomplete
4: Set Subtraction
incomplete
This lesson's interactive features are locked, please to keep using them
The anti-spam team at Fantasy Quest is doing text analysis on players' in-game chats.
Complete the count_vowels function. It takes a string and returns:
The total number of vowels in the string (count every occurrence, not just unique)
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.
Create a set of the ten vowels (both lowercase and uppercase)
Create a counter started at 0
Create an empty set to store the unique vowels
Iterate over the characters in the string, for example:
for char in text:
# do stuffIf the character is in the set of vowels:
Increment the counter
Add the character to the set of unique vowels
Return the counter and the set of unique vowels
my_new_set = set()my_new_set = {"apple", "banana", "grape"}