The only problem with this if it is to big or to deeply nested then it will overflow the stack?
Mario Rol wrote: > nice and concise, found on comp.lang.python: > > def flatten(a): > if not isinstance(a,(tuple,list)): return [a] > if len(a)==0: return [] > return flatten(a[0])+flatten(a[1:]) > > _________________________________________________________________ > Play online games with your friends with MSN Messenger > http://messenger.msn.nl/ > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > > __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor