test
This commit is contained in:
18
task_18.py
Normal file
18
task_18.py
Normal file
@@ -0,0 +1,18 @@
|
||||
sentence = input("Введите предложение: ")
|
||||
|
||||
vowels = "аеёиоуыэюяАЕЁИОУЫЭЮЯ"
|
||||
consonants = "бвгджзйклмнпрстфхцчшщБВГДЖЗЙКЛМНПРСТФХЦЧШЩ"
|
||||
|
||||
vowel_count = 0
|
||||
consonant_count = 0
|
||||
|
||||
for char in sentence:
|
||||
if char == ' ':
|
||||
continue
|
||||
if char in vowels:
|
||||
vowel_count += 1
|
||||
if char in consonants:
|
||||
consonant_count += 1
|
||||
|
||||
print(f"Гласных букв: {vowel_count}")
|
||||
print(f"Согласных букв: {consonant_count}")
|
||||
Reference in New Issue
Block a user