Answer to Question #259139 in Python for SUDHEER

Question #259139

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

1
Expert's answer
2021-10-30T23:55:30-0400
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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog