input: Write a python function to print a pattern of stars based on the input number of rows.
  assert print_pattern(3)=="* \n* * \n* * * \n"
  assert print_pattern(5)=="* \n* * \n* * * \n* * * * \n* * * * * \n"
  assert print_pattern(1)=="* \n"
output: def print_pattern(n):
      result = ""
      for i in range(1, n+1):
          result += "* " * i + "\n"
      return result