[Tutor] Better structure?

Sandip Bhattacharya sandip at lug-delhi.org
Thu Feb 3 05:51:50 CET 2005


>    for x in string:
>        if x in chars:
>            string[i] = ''

I just have a hangover from other languages, but I really wanted to know 
how Python handles iteration over a variable which is being changed 
within the loop itself. Is the "for" condition evaluated in every loop?

- Sandip



More information about the Tutor mailing list