input: Write a python function to generate Pascal's triangle up to the given number of rows.
  assert generate_pascals_triangle(1) == [[1]]
  assert generate_pascals_triangle(2) == [[1], [1, 1]]
  assert generate_pascals_triangle(3) == [[1], [1, 1], [1, 2, 1]]
  assert generate_pascals_triangle(4) == [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]]
  assert generate_pascals_triangle(5) == [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]]
  assert generate_pascals_triangle(6) == [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1], [1, 5, 10, 10, 5, 1]]
output: def generate_pascals_triangle(rows):
      if rows == 0:
          return []
      result = [[1]]
      for i in range(1, rows):
          row = [1]
          for j in range(1, i):
              row.append(result[i-1][j-1] + result[i-1][j])
          row.append(1)
          result.append(row)
      return result