Anti_vowel


#1

I am confused why the third 'o' don't be remove??

Does anyone know?thank you


#2

you are removing from the same string as your are looping over, this causes index shift (which causes problems for successive vowels), because when the first o of look gets removed, everything shift one index to the left, causing the second o of look to be skipped


#3

I seem to understand what you mean, but I still did not think of the method of modification, can you please be more specific? Thank you


#4

be more specific in what matter?


#5

I can't think how to make it text list is deleted when the position is unchanged?I don't know whether I understand the expression, my English is not good


#6

you mean: How can i use remove() and overcome the index shift problem?

I wouldn't personally use remove, i would use the opposite approach, append constants to a new list.

but if you really want to use remove, you could store your list in a different variable (for example text_list), then loop over text while removing from text_list


#7

how stupid i am!thank you !A few days ago, I had a problem and you helped . thank you so much


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.