Write a program to count the number of occurrences of any two vowels in succession
in a line of text. For example, in the sentence
“Pleases read this application and give me gratuity” such occurrences are ea, ea, ui.
def IsVowel(ch):
return (ch.lower() in ['a', 'e', 'i', 'o', 'u'])
source = input()
count = 0
for i in range(0, len(source) - 1):
if IsVowel(source[i]) and IsVowel(source[i+1]):
count += 1
print('The number of occurrences of any two vowels in succession is', count)
Comments
Leave a comment