[Solved] Python : replacing words while iterating [closed]


You should give a code that actually creates the error you get, as stated from other people in the comments.

Anyway, in your code, i will be a string, not a list, because you are iterating the list from split with your loop. So, maybe you should use if i == 'because' rather than if 'because' in i?

4

solved Python : replacing words while iterating [closed]