From 3dc1a9d708934ac1668c1a14c18e95629c7cb46c Mon Sep 17 00:00:00 2001 From: stud203999 Date: Sat, 25 Apr 2026 12:05:17 +0300 Subject: [PATCH] add code v2 --- maingit.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/maingit.py b/maingit.py index ba3b655..32a1ac5 100644 --- a/maingit.py +++ b/maingit.py @@ -1,19 +1,15 @@ def count_vowels(s: str) -> int: - count = 0 - for ch in range(len(s)): - if(s[ch] == "а" or s[ch] == "е" or s[ch] == "и" or s[ch] == "ы" or s[ch] == "о" or s[ch] == "у" or s[ch] == "ю" or s[ch] == "я" or s[ch] == "э" or s[ch] == "а"): - count += 1 - #print(s[ch]) - print(count) - - - - + count = 0 + for ch in range(len(s)): + if (s[ch] == "а" or s[ch] == "е" or s[ch] == "и" or s[ch] == "ы" or s[ch] == "о" or s[ch] == "у" or s[ + ch] == "ю" or s[ch] == "я" or s[ch] == "э" or s[ch] == "а"): + count += 1 + # print(s[ch]) + return count def main(): print(count_vowels("Привет мир")) - if __name__ == "__main__": main()