[issue38058] Tutorial: 4.2. for Statements

2019-09-08 Thread Kevin
Change by Kevin : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-lis

[issue38058] Tutorial: 4.2. for Statements

2019-09-08 Thread Kevin
New submission from Kevin : >>> # Measure some strings: ... words = ['cat', 'window', 'defenestrate'] >>> for w in words: ... print(w, len(w)) ... cat 3 window 6 defenestrate 12 If you need to modify the sequence you are iterating over while inside the loop (for example to duplicate selec