Hi guys, I’m really having difficulties with with this chapter and am doing my best to not rely on the forums for answers. So, instead of just looking at the straight-up answer, I’m going to ask for help.
<In what way does your code behave incorrectly? Include ALL error messages.>
The code does not throw out any errors. “Hey look words!” will return with “Hey lk wrds!”. I can’t find the pattern to this code. It runs, but I don’t know what it’s doing. “Babinga” will return “bbing”. “Am”, “AAAm”, “am”, and “aaam” will work. Different vowels placed next to each other will only make the code remove the latter letter (“Aam” will return “Am”).
<What do you expect to happen instead?>
The code is supposed to iterate through the text. If a letter in the text is found in the “vowels” string, the code should eliminate the letter.
vowels = “AEIOUaeiou"
for letter in text:
if letter in vowels:
novowelword = text.replace(letter,”")