Data Structures, Data Engineering, Arrays, Algorithms, Data Science.
often used. For Loop: for row in two_d_array: for element in row: print(element, end=' ') print() # Outputs: 1 9 3 \n 4 5 6 \n 7 8 2 While Loop: i = 0 while i < len(two_d_array): j = 0 while j < len(two_d_array[i]): print(two_d_array[i][j], end=' ') j += 1 i += 1 print() # Outputs: 1 9 3 \n 4 5 6