Not the most elegant solution, perhaps, but: >>>t = [ "a", "b", "c", "n", "a", "a", "t", "t", "t" ] >>>outlist = [] >>>for x in range(3): ... temp=[] ... for y in range(len(t)/3): ... temp.append(t[3*y+x]) ... outlist.append(temp) >>>outlist [['a', 'n', 't'], ['b', 'a', 't'], ['c', 'a', 't']] -- Brendon Towle, PhD Cognitive Scientist +1-412-690-2442x127 Carnegie Learning, Inc. The Cognitive Tutor Company ® Helping over 375,000 students in 1000 school districts succeed in math. |
-- http://mail.python.org/mailman/listinfo/python-list