I am trying to populate a 3D list in the following fashion:
l1 = []
for _ in range(5):
l2 = []
for _ in range(10):
l2.append([0] * 20)
l1.append(l2)
It looks really disgusting and I feel like there should be some way to use higher order function or anon functions or list comprehension to achieve this. Can any python ninjas show me how to achieve this?
Thanks!