fork(1) download
  1. structure = [3, 2, 10]
  2. final = []
  3. for i in structure:
  4. layer = [[]]
  5. for k in range(1, i):
  6. layer.append([])
  7. final.append(layer)
  8. print(str(final))
Success #stdin #stdout 0.1s 14140KB
stdin
Standard input is empty
stdout
[[[], [], []], [[], []], [[], [], [], [], [], [], [], [], [], []]]