python how to make a for i < 3 code example Example: for each loop python 3 # 'foreach' in python is done using 'for' for val in array: print(val)