Answers for "python code for counting vowels in a string"

5

count how many vowels in a string python

def vowel_count(string):
  vowels = ['a', 'e', 'i', 'o', 'u']
  return len([i for i in string if i in vowels])
Posted by: Guest on December-04-2020
1

find number of vowels in string python

string = list(map(str, input().lower()))
lst = []
for i in range(0, len(string)):
  if string[i]=='a' or string[i]=='e' or string[i]=='i' or string[i]=='o' or string[i]=='u':
    lst.append(string[i])
print(len(lst))
Posted by: Guest on November-09-2021

Code answers related to "python code for counting vowels in a string"

Python Answers by Framework

Browse Popular Code Answers by Language