words = ['cat', 'window', 'defenestrate']
for w in words:
    print(w, len(w))

for w in words[:]:
    if len(w) > 6:
        words.insert(0, w)

# Infinite loop.
# for w in words:
#     print(w)
#     if len(w) > 6:
#         words.insert(0, w)

print(words)

words = ['cat', 'window', 'defenestrate']
for w in words:
    print(w, len(w))

for w in words[:]:
    if len(w) > 6:
        words.insert(0, w)

# Infinite loop.
# for w in words:
#     print(w)
#     if len(w) > 6:
#         words.insert(0, w)

print(words)

# Infinite loop. # for w in words: #     print(w) #     if len(w) > 6: #         words.insert(0, w)