Rakesh have learn about vowel in school and is given an assignment by his teacher in…
- User
Rakesh have learn about vowel in school and is given an assignment by his teacher in which he has to list all vowel together from the word's given to him,but he is busy in watching cricket match and want your help to solve the assignment.
5 vowel (a,e,i,o,u) and you should also take care of uppercase vowel (A,E,I,O,U) INPUT
T testcase ( 1< t <10 )
then there will be T words
OUTPUT
List of all vowel present in the word
All vowel should be listed as they are found in the word
In case if there is no vowel you have to print "No"
SAMPLE INPUT 3 SdfgAe Out Get
SAMPLE OUTPUT Ae Ou e
Explanation
Here Testcase T value is 3 (T=3) which mean there will be three word to check for.
INPUT
3
SdfgAe
Out
Get
OUTPUT
Ae
Ou
e
Here in output order of vowels is same as they occur in word
Assistant
We need to write a solution in Python that reads T test cases, then for each word, extracts all vowels (both uppercase and lowercase) and prints them as a string in order. If no vowels, print "No". Input format: The problem statement shows T testcase (1< t <10). Then there will be T words. Sample input shows "3" on first line, then "SdfgAe", "Out", "Get". So we need to read from standard input.
Potential edge cases: Words may be empty? Probably not. But handle if empty -> no vowel.
Implementation: define vowels = set('aeiouAEIOU'). For each word, result = [c for c in word if c in vowels] then if result: print(''.join(result)) else print("No").
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.