```
class Solution(object):
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
if numRows <= 0:
return []
triangle = [[1]]
for i in range(1, numRows):
row = [0] + triangle[-1] + [0]
triangle.append([row[j]+row[j+1] for j in range(i+1)])
return triangle
```