Hello, I wonder why my code is only partially working.
for char in text:
if char in “aeioAEIOU”:
string = text.replace(char, “”)
print anti_vowel(“Hey look Words”)
I get back Hey lk Wrds.
when I print the char it prints e,o,o,o but it doesn’t replace the e.
also if I give it “Hey Look” I get back Hy Lk.
I also tried to give it a max value replace(char, “”, 10), it didn’t make any difference.
I can think of other ways to write this function, for example with append to a new string instead of replacing but I would really like to know why its only partially working.