input: from typing import List
  
  def transpose(A: List[List[float]]) -> List[List[float]]:
      """ Transpose a 2D array. The function inputs a 2D array A and outputs its transpose.
      >>> transpose([[1.0, 2.0], [3.0, 4.0]])
      [[1.0, 3.0], [2.0, 4.0]]
      >>> transpose([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
      [[1.0, 4.0], [2.0, 5.0], [3.0, 6.0]]
      """
output:     transposed = []
      for i in range(len(A[0])):
          row = []
          for j in range(len(A)):
              row.append(A[j][i])
          transposed.append(row)
      return transposed