Для гласных букв русского алфавита
def f():
s = input('Введите строку': )
words = s.split(' ')
words = [word for word in words if word[-1] not in "аоэиуыеёюя"]
return ' '.join(words)
Для гласных букв английского алфавита
def f():
s = input('Введите строку': )
words = s.split(' ')
words = [word for word in words if word[-1] not in "aeiouy"]
return ' '.join(words)