Hello, How can I disgrate (probably not a good word for it) a list? For example:
a = [1,2] b = 3 c = [a] + [b] # which makes [[1,2],3] Then how can I change c ([[1,2],3]) into [1,2,3]? I have a simple function for this: ======================== def flatten(l): r = [] s = [l] while len(s) > 0: i = s.pop() if i.__class__ == list: for c in i: s.append(c) else: r.append(i) return r ======================== But this function isn't really doing it in the "python-way". Doesn't have python an obscure function or buildin to do this? Greetz, Noud Aldenhoven -- http://mail.python.org/mailman/listinfo/python-list