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?
(edited to fix)
Here is one way to do it:
to make it into a function: