Skip to content
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