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