#!/usr/bin/python3 list_ = ['a', 'b', 'c'] for element in list_: print(element) for index, element in enumerate(list_): print('{} {}'.format(index, element)) for index, element in enumerate(list_): if index <= 1: print('{} {}'.format(index, element)) else: # exit the loop early, do not execute the for loop's else break else: print('exited loop after all 3 elements processed') print('done')