I am looking to create a board in python with a 3x3 grid containing the values of 1-49.
Each numbers in the grid need to be able to be changed and replaced etc so the range function can't be used.
def board():
board = [[1,2,3],
[4,5,6],
[7,8,9]]
for i in board:
print(i)
board()
The above code is all I have managed so far. The output displays a very amature-looking grid and it is not formatted nicely. Additionally, if I want to make the grid larger, say 7x7, the numbers do not line up properly.
The output displays the following:
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
How can I create and display a grid that looks neat with the numbers lining up in rows and columns with me being able to change the numbers in the grid.