input: Write a python function to traverse a 2D matrix and print its elements in a row-wise manner.
  assert traverse_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == "1 2 3 \n4 5 6 \n7 8 9 \n"
  assert traverse_matrix([[10, 20], [30, 40], [50, 60]]) == "10 20 \n30 40 \n50 60 \n"
  assert traverse_matrix([[5, 10, 15], [20, 25, 30]]) == "5 10 15 \n20 25 30 \n"
output: def traverse_matrix(matrix):
      result = ""
      for row in matrix:
          result += " ".join(map(str, row)) + " \n"
      return result