foreach apply predicate python code example
Example 1: py foreach
names = ['tom', 'john', 'simon']
namesCapitalized = [capitalize(n) for n in names]
Example 2: for each loop python 3
# 'foreach' in python is done using 'for'
for val in array:
print(val)