grid = [[4, 9, 2], [3, 5, 7], [8, 1, 6]]
if all(x in grid for x in [1, 2, 3, 4, 5, 6, 7, 8, 9]):
print('yes')
This doesn't print anything when tried however when I do the same with a normal list containing the numbers 1 through 9 it prints just fine. How would I check if the values 1 through 9 are contained within a 2d list?