Given a string of the lyrics of a song find out how many words in it begin with a vowel.

Note: Make sure you check for both uppercase and lowercase vowels.

Input 1: Lyrics: "City of stars, are you shining just for me? City of stars, you never shined so brightly!"
Output 1: 3

Python how many words in a song begin with Vowels

# Read the input
s = input()

words = str.split(s, ' ')

count = 0

for i in words:
    if(i[0] in 'aeiouAEIOU'):
        count += 1

print(count)

Comments