On Wed, Jul 9, 2014 at 8:27 AM, sssdevelop <sssdeve...@gmail.com> wrote: > prev = 0 > blocks = [] > tmp = [] > last = 0 > for element in a: > if prev == 0:
Is 0 allowed to be in the input list? What would happen if it were? > next This line doesn't do anything. It looks up the builtin function named next and then does nothing with it. I suspect you meant to use the keyword 'continue' here. > if tmp: > pass > else: > tmp.append(prev) if not tmp: tmp.append(prev) Also, give tmp a more meaningful name. Call it "current_block" or something descriptive like that. -- https://mail.python.org/mailman/listinfo/python-list