Skip to content

Instantly share code, notes, and snippets.

@MahraibFatima
Created March 19, 2024 16:14
Show Gist options
  • Save MahraibFatima/129e3589a956c70fd849cc20994c8a6e to your computer and use it in GitHub Desktop.
Save MahraibFatima/129e3589a956c70fd849cc20994c8a6e to your computer and use it in GitHub Desktop.
Count the number of vowels in the input string.
def count_vowels(s):
vowels = 'aeiouAEIOU'
count = 0
for char in s:
if char in vowels:
count += 1
return count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment