From 1d6cb1dc77ed75067fbc3ba035de14c2bb60c193 Mon Sep 17 00:00:00 2001 From: Kumar Abhishek Date: Sat, 19 Oct 2024 17:48:51 +0530 Subject: [PATCH 1/2] Create vowel_check.py --- strings/vowel_check.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 strings/vowel_check.py diff --git a/strings/vowel_check.py b/strings/vowel_check.py new file mode 100644 index 000000000000..5e341c45cbdc --- /dev/null +++ b/strings/vowel_check.py @@ -0,0 +1,14 @@ +String = input('Enter the string :') +count = 0 +#to check for less conditions +#keep string in lowercase +String = String.lower() +for i in String: + if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u': + #if True + count+=1 +#check if any vowel found +if count == 0: + print('No vowels found') +else: + print('Total vowels are :' + str(count)) From d7448318c9891cddc879c5240b34d12af05bc0b1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 19 Oct 2024 12:19:35 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- strings/vowel_check.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/strings/vowel_check.py b/strings/vowel_check.py index 5e341c45cbdc..e62b5299a512 100644 --- a/strings/vowel_check.py +++ b/strings/vowel_check.py @@ -1,14 +1,14 @@ -String = input('Enter the string :') +String = input("Enter the string :") count = 0 -#to check for less conditions -#keep string in lowercase +# to check for less conditions +# keep string in lowercase String = String.lower() for i in String: - if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u': - #if True - count+=1 -#check if any vowel found + if i == "a" or i == "e" or i == "i" or i == "o" or i == "u": + # if True + count += 1 +# check if any vowel found if count == 0: - print('No vowels found') + print("No vowels found") else: - print('Total vowels are :' + str(count)) + print("Total vowels are :" + str(count))