input: from typing import List
  
  def PascalTriangle(n: int) -> List[List[int]]:
      """ Generate Pascal's Triangle up to n rows and return it as a list of lists.
      >>> PascalTriangle(5)
      [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]]
      >>> PascalTriangle(3)
      [[1], [1, 1], [1, 2, 1]]
      """
output:     if n <= 0:
          return []
  
      triangle = [[1]]
  
      for i in range(1, n):
          row = [1]
          for j in range(1, i):
              row.append(triangle[i-1][j-1] + triangle[i-1][j])
          row.append(1)
          triangle.append(row)
  
      return triangle