Loop through a list: for in
a = ['cat', 'window', 'defenestrate'] for x in a[:]: # make a slice copy of the entire list if len(x) > 6: a.insert(0, x) print a
1. | List for iteration | ||
2. | For Statements | ||
3. | To iterate over the indices of a sequence, combine range() and len() | ||
4. | For loop demo | ||
5. | For loop for List |