Aug-06-2018, 10:26 AM
(Aug-06-2018, 10:18 AM)buran Wrote:def flatten(lst): result = [] for item in lst: if isinstance(item, (list, tuple)): # You may add more container types if needed result.extend(flatten(item)) else: result.append(item) return result
This is the reason I like Python - smart people (like buran) can achieve desired results with minimal and very readable piece of code. I have lot of work to do in smart part
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.