#528 · Strings · Beginner · 25 XP · about 4 min
Write vowels_and_consonants(text) that counts the letters in text and returns a tuple (vowels, consonants).
vowels_and_consonants('Hello World') # returns (3, 7) vowels_and_consonants('Sky 2024!') # returns (0, 3) vowels_and_consonants('') # returns (0, 0)
In 'Hello World' the vowels are e, o and o, and the other 7 letters are consonants.
First solves only, ranked by stars and then time.