input: Write a python function to print a triangle of stars with a given number of rows.
  assert print_triangle(3) == "*
  * *
  * * *"
  assert print_triangle(5) == "*
  * *
  * * *
  * * * *
  * * * * *"
output: def print_triangle(n):
      result = []
      for i in range(1, n + 1):
          result.append("* " * i)
      return "\n".join(result).strip()