def filter_gen5(s): vowels = "aeiouAEIOU" for ch in s: if ch in vowels: yield ch while True: print("фильтрация гласных") print("1 - Ввести строку") print("0 - Выход") choice = input("Выбор: ") if choice == "0": break if choice == "1": try: s = input("Введите строку: ") gen = filter_gen5(s) print("Результат:") for ch in gen: print(ch) except: print("Ошибка")