input: Write a function to generate and print a Pascal triangle up to the specified number of rows. Return the array representing the Pascal triangle.
  assert PascalTriangle(5)==[[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]]
  assert PascalTriangle(1)==[[1]]
  assert PascalTriangle(0)==[]
  assert PascalTriangle(3)==[[1], [1, 1], [1, 2, 1]]
  assert PascalTriangle(4)==[[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]]
output: def PascalTriangle(numRows):
      if numRows == 0:
          return []
      triangle = [[1]]
      for i in range(1, numRows):
          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