input: from typing import List
  
  def PascalTriangle(n: int) -> List[List[int]]:
      """ Generate and print Pascal's triangle up to the given number of rows.
      >>> PascalTriangle(5)
      [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]]
      """
output:     triangle = []
      for i in range(n):
          row = [1] * (i + 1)
          for j in range(1, i):
              row[j] = triangle[i-1][j-1] + triangle[i-1][j]
          triangle.append(row)
      return triangle