Hacker News new | ask | show | jobs
by linkedlist007 3404 days ago
#python code

def flat(x):

  if type(x) == type([]) and len(x)==1:

    return flat(x[0])

  if type(x) == type([]) and len(x)>1:

    return flat(x[0]) + flat(x[1:])

  else:

    return [x]