22 - python & all web labs

This commit is contained in:
2026-05-02 20:27:02 +05:00
parent ef77f101fa
commit 19af922baf
5781 changed files with 770492 additions and 96 deletions

25
labPython/lab21/task_2.py Normal file
View File

@@ -0,0 +1,25 @@
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("Ошибка")