Many and few X18322


Statement
 

pdf   zip

Write a function @many_few(f)@ that given a list ff of nonempty strings of lowercase letters, returns two lists. The first one is formed by the words in ff that have more consonants than vowels. At the second one there are the words in ff that have at least as many vowels as consonants. The order of appearance of the words in each of the two resulting lists must preserve the original order.

Sample session

Sample session
>>> many_few(['evening', 'morning', 'seat', 'people', 'table', 'oak'])
(['evening', 'morning', 'table'], ['seat', 'people', 'oak'])
>>> many_few(['evening', 'morning', 'table'])
(['evening', 'morning', 'table'], [])
>>> many_few(['seat' , 'oak'])
([], ['seat', 'oak'])
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python