Code:
idx = b.index(input("enter an adjacent number:"))
numList[numList.index(empty)] = 'b'
numList[idx] = 'a'
Code:
def boardStr(cols, rows, empty=1):
numList = [str(i) for i in range(1, (cols*rows-empty)+1)]
random.shuffle(numList)
numList += ['_' for i in range(empty)]
outStr = ''
Leave a comment: