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)
Every thing is correct,
Except,
In this we have remove uppercase letters also
So please make code for me
string = input("Enter any string: ")
if string == 'x':
exit();
else:
newstr = string;
vowels = ('a', 'e', 'i', 'o','u');
vowel = ('A', 'E', 'I', 'O','U');
for x in string.lower():
if x in vowels:
newstr = newstr.replace(x,"");
print(newstr)
stri = input("Enter any string: ")
if stri == 'x':
exit();
else:
newstri = stri;
for n in stri.upper():
if n in vowel:
newstri = newstri.replace(n,"");
print(newstri)
Comments
Leave a comment