Answers for "frequency of each vowel"

0

frequency of each vowel

# Program to count the number of each vowels

# string of vowels
vowels = 'aeiou'

ip_str = 'Hello, have you tried our tutorial section yet?'

# make it suitable for caseless comparisions
ip_str = ip_str.casefold()

# make a dictionary with each vowel a key and value 0
count = {}.fromkeys(vowels,0)

# count the vowels
for char in ip_str:
   if char in count:
       count[char] += 1

print(count)
Posted by: Guest on December-12-2020

Code answers related to "frequency of each vowel"

Python Answers by Framework

Browse Popular Code Answers by Language