forEach function python code example Example: for each loop python 3 # 'foreach' in python is done using 'for' for val in array: print(val)