>>>m=[[1,2],[3,4]]
>>>m[0][0]=9
[[9, 2], [3, 4]]
>>> m=[0 for e in range(10)]
>>> m
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>>> a=[3,4,5]
>>> b=[1,2,3]
>>> m=[a*e for e in b]
>>> m
[[3, 4, 5], [3, 4, 5, 3, 4, 5], [3, 4, 5, 3, 4, 5, 3, 4, 5]]
>>> m=[2*e for e in a]
>>> m
[6, 8, 10]
沒有留言:
張貼留言