array python foreach code example Example: py foreach names = ['tom', 'john', 'simon'] namesCapitalized = [capitalize(n) for n in names]