I wrote a really simple code to create some nested lists, and I got an unexpected problem, that while loop doesn't end. Have no idea what is wrong in it. If you have any clues, would much appreciate it)
import random
square = [0,0,0,0,0,0,0,0,0]
squares = []
def allsquares():
    for i in range(9):
        squares.append(square)
    return squares 
def autofill():
        for i in range(9):
            fn = random.randint(1,3)
            sn = random.randint(6,8)
            for s in range(fn,sn):
                print('Mary Sue')
                d = True
                while d:
                    x = random.randint(0,8)
                    print(x)
                    if squares[i][x] == 0:
                        d = False
                squares[i][x] = random.randint(1,9)
        return squares
allsquares()
autofill()
print(squares[2])
 
    