Skip to content

vowel_check.py #12187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions strings/vowel_check.py
Original file line number Diff line number Diff line change
@@ -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":

Check failure on line 7 in strings/vowel_check.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (PLR1714)

strings/vowel_check.py:7:8: PLR1714 Consider merging multiple comparisons: `i in ("a", "e", "i", "o", "u")`. Use a `set` if the elements are hashable.
# if True
count += 1
# check if any vowel found
if count == 0:
print("No vowels found")
else:
print("Total vowels are :" + str(count))
Loading