Remove Vowels in a Sentence
You are given a sentence. Write a program to remove all the vowels in the given sentence.
Note: Sentence has both lowercase and uppercase letters.
Input
The first line of input is a string
N.
Explanation
In the example given a sentence
Hello World, the sentence contains vowels e, o.
So, the output should be
Hll Wrld.
Sample Input 1
Hello World
Sample Output 1
Hll Wrld
Sample Input 2
Once upon a time
Sample Output 2
nc pn tm
Python 3.9
RESET
SAVE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
string = input()
if string == 'x':
exit();
else:
newstr = string;
vowels = ('a', 'e', 'i', 'o', 'u');
for x in string.lower():
if x in vowels:
newstr = newstr.replace(x,"");
print(newstr);
Custom Input
RUN CODE
SUBMIT
TEST CASE 1
TEST CASE 2
Input
1
Once upon a time
Diff
Your Output
Onc pn tm
Expected
nc pn tm
Comments
Leave a comment