```
class Solution(object):
def generate(self, numRows):
n= numRows
if n==0: return []
if n==1: return [[1]]
l = [[] for i in xrange(n)]
l[0].append(1)
for i in xrange(1,n):
l[i].append(1)
for j in xrange(1, len(l[i-1])):
l[i].append(l[i-1][j-1]+l[i-1][j])
l[i].append(1)
return l
```