Remove Vowels in a Sentence
You are given a sentence. Write a program to remove all the vowels in the given sentence.
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
string = input("Enter any string: ")
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);
Comments
Leave a comment