I know that it is not safe to modify the list during an iterative looping. However, suppose I have a list of strings, and I want to strip the strings themselves. Does replacement of mutable values count as modification?
See Why doesn't modifying the iteration variable affect subsequent iterations? for a related problem: assigning to the iteration variable does not modify the underlying sequence, and also does not impact future iteration.
It’s considered poor form. Use a list comprehension instead, with slice assignment if you need to retain existing references to the list.