vowels = 'aeyuio' + 'aeyuio'.upper()
test = 'ryehjh yiuihkUdio hkkjkde hyihkooooocudsiu aaahh jhhkjwe yiuihkUdio'
def f(w):
return len(list(filter(lambda x: x in vowels, w))) >= len(w) / 2
n = set(list(filter(f, test.split(' '))))
for i in n:
print(i)
Или так...
vowels = 'aeyuio' + 'aeyuio'.upper()
test = 'ryehjh yiuihkUdio hkkjkde hyihkooooocudsiu jhhkjwe yiuihkUdio'
def f(w):
c = 0
for i in w:
if i in vowels:
c += 1
return c >= len(w) / 2
n = set(list(filter(f, test.split(' '))))
for i in n:
print(i)