def iter_copy(structure):
 l = []
 for i in structure:
  if hasattr(i, '__iter__'):
   l.append(iter_copy(i))
  else:
   l.append(i)
 return l

def iter_copy ( structure ) : l = [ ] for i in structure : if hasattr ( i , '__iter__' ) : l . append ( iter_copy ( i ) ) else : l . append ( i ) return l
returns a copy of an iterable object .