I think that would be a suitable solution for this problem.
import random y = [] def autoSolve(): x = [] for i in range(5): z = random.randrange(1, 10) x.append(z) y.append(x) print(y, end="") for i in range(3): print("number", i + 1,) autoSolve() print()
here the output will be generated, because it is [[], [], []] formate List with 3 internal list of 5 elements
source share