structure = [3, 2, 10]final = []for i in structure: layer = [[]] for k in range(1, i): layer.append([]) final.append(layer)print(str(final))
Standard input is empty
[[[], [], []], [[], []], [[], [], [], [], [], [], [], [], [], []]]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!