+ 1
It doesn't work :(
Why doesn't the commented part do what I expect? Essentially, every time this code encounters a vowel, it prints said vowel and then "f" + vowel (e.g. "hello" ---> "hefellofo"). I want the code not to print anything after an "i" ONLY IF it is between a "g" or a "c" and a vowel (e.g. "gio", "cia", etc.; the results should then be "giofo", "ciafa", etc.). https://code.sololearn.com/cCH7ONFnrwpr/?ref=app
2 Antworten
+ 1
(str(word.index(letter) + 1) doesn't work very well because it does not return a letter, instead it returns the index number (Example Output: "2"). You should replace str(index) with word[index] this returns the character of the index number