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