Keep looping, know to find 9 different numbers in line = []
import random
matrix = []
for i in range(9):
line = []
j = 1
while j <= 9:
number = random.randint(1, 9)
if number not in line:
line.append(number)
j += 1
matrix.append(line)
for i in range(9):
print(matrix[i])
0
solved Truble to create a matrix for sudoku in python