[CODE=python]def dis(self):
temp=[]
list=[]
for i in combilist:
print list
if i!=0:
temp.append(i)
else:
print temp
list.append(tem p)
print list
while temp:
temp.pop()
return[/CODE]
combilist is....[1,0,2,0,3,4,5,0]
list should comes out as [[1],[2],[3,4,5]]
and temp is used for temporarily storage...
but the output is comin out to be sumthin unexpected.....
please tell me wat's the problem with the code...
why is the list not appending correctly????
temp=[]
list=[]
for i in combilist:
print list
if i!=0:
temp.append(i)
else:
print temp
list.append(tem p)
print list
while temp:
temp.pop()
return[/CODE]
combilist is....[1,0,2,0,3,4,5,0]
list should comes out as [[1],[2],[3,4,5]]
and temp is used for temporarily storage...
but the output is comin out to be sumthin unexpected.....
please tell me wat's the problem with the code...
why is the list not appending correctly????
Comment