input: from typing import List
  
  def pascal_triangle(n: int) -> List[List[int]]:
      """
      Generate and print Pascal's triangle for a given number of rows.
      
      >>> pascal_triangle(5)
      [[1]]
      [[1], [1, 1]]
      [[1], [1, 1], [1, 2, 1]]
      [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]]
      [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]]
      """
      if n < 1:
          return []
      
      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)
          print(triangle)
      
      return triangle
output:     if n < 1:
          return []
      
      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)
          print(triangle)
      
      return triangle