Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14155

Python: Is there a way to remove a character without regard to capitalization? [duplicate]

$
0
0

My code is supposed to remove vowels from the user inputted string. It works correctly, but I'm trying to see if there is a way to simplify my code. A screenshot of my code

I originally didn't have the line:

     elif i == "A" or i == "E" or i == "I" or i == "O" or i == "U":        n.replace(i, "")        output = output

but I added it because when my input contained capitalized vowels it would not remove the vowels because they were capitalized.

Is there a way to rewrite my code so I can remove the vowels that are both lowercase and capitalized without the extra lines?


Viewing all articles
Browse latest Browse all 14155

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>