input: Write a function to print a right-angled triangle pattern of stars with n rows.
  assert print_triangle(3)=="* \n* * \n* * * \n"
  assert print_triangle(5)=="* \n* * \n* * * \n* * * * \n* * * * * \n"
  assert print_triangle(1)=="* \n"
output: def print_triangle(n):
      return '\n'.join(' '.join('*' for _ in range(i + 1)) for i in range(n)) + ' \n'