In this i have come up with a interview question which was asked in the NQT conducted by Tata Consultancy Services on October 27,2020. I have used Python language to solve this problem.
Problem Statement :
Take a single line text message from user. Separated the vowels from the text. Find the repeating occurrences of vowels from the text message.
Display count of which vowel has repeated how many times.Display a new Text message by removing the vowel characters as output.
Display the output in exact format shown below in example, after displaying count of characters on the next lines display the new text message on next line.
"Hll wlcm" is the new text message if text message entered by user does not contain any numeric value then display 0 as output.
If user entered blank or empty text message display "INVALID INPUT" as output. Message "INVALID INPUT" is case senstive. Display it in exact format given .
Case 1:
Input :
Hello Welcome
Hello Welcome
Output :
a:0
e:3
i:0
o:2
u:0
Hll Wlcm
Case 2:
Input :
Hll wlcm
Output :
0
Program:
Output:
That's all. I hope this will help you.
0 Comments