python怎么將一個(gè)數(shù)組中的0全部換成另一個(gè)數(shù)字?
alist = [1,3,5,2,0,3,7,0,0,3,7]for i in range(len(alist)): if alist[i] == 0: alist[i] = 1print alist
python怎么將一個(gè)數(shù)組中的0全部換成另一個(gè)數(shù)字?
alist = [1,3,5,2,0,3,7,0,0,3,7]for i in range(len(alist)): if alist[i] == 0: alist[i] = 1print alist