input: Write a python function to create a pyramid pattern using dots.
  assert pyramid(1) == "."
  assert pyramid(2) == "  . \n.. .. "
  assert pyramid(3) == "    . \n  .. .. \n... ... ... "
output: def pyramid(n):
      result = []
      for i in range(1, n + 1):
          row = ' ' * (n - i) * 2 + '. ' * i
          result.append(row.rstrip())
      return '\n'.join(result)