input: Write a python function to print a right-angled triangle pattern of asterisks of height n.
  assert triangle_pattern(3) == "* \n* * \n* * * \n"
  assert triangle_pattern(4) == "* \n* * \n* * * \n* * * * \n"
  assert triangle_pattern(5) == "* \n* * \n* * * \n* * * * \n* * * * * \n"
output: def triangle_pattern(n):
      pattern = ""
      for i in range(1, n + 1):
          pattern += "* " * i + "\n"
      return pattern