Many and few X18322


Statement
 

pdf   zip

html

Write a function many_few(f) that given a list f of nonempty strings of lowercase letters, returns two lists. The first one is formed by the words in f that have more consonants than vowels. At the second one there are the words in f 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
>>> 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