In this program, we will take a string as input and count vowels in each word in the given string show as dictionary output
Steps to solve the program
- Take a string as input.
- Convert the string of words into a list using split() method and create another string that contains all the vowels, also create an empty dictionary.
- Use For loop to iterate over every word in the list and count the number of vowels it contains.
- Add the word as key and its vowel count as the value in the dictionary.
- Repeat the process for each word.
- Print the output.
Output :