Vowels in each word of string show as dictionary

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
  1. Take a string as input.
  2. 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.
  3. Use For loop to iterate over every word in the list and count the number of vowels it contains.
  4. Add the word as key and its vowel count as the value in the dictionary.
  5. Repeat the process for each word.
  6. Print the output.

Output :

exchange the first and last character of each word from the given string.

repeat vowels 3 times and consonants 2 times.

Leave a Comment