2011-10-13 16 views

回答

8

那倒成爲:

[x[:i] for i in range(len(x) + 1)] 
2
x = [1, 2, 3, 4] 
print [x[:i] for i in xrange(len(x) + 1)] 
相關問題