I'm attempting to build a code which creates a list of 9 lists, each also holding 9 elements. I've created a converter to validate the size of each entry, then splits them into the individual elements of its separate. It properly notices incomplete lengths and requires the proper number of valid inputs before outputting, but for some reason each index that had read invalid the first time around will not return the new, valid input. Below is the code.
Is it just some simple syntax that i'm overlooking or is my code not sufficient enough?
print('Please enter your line with no spaces or commas')
board_list = [[], [], [], [], [], [], [], [], []]
def convert(line):
li = [int(x) for x in str(line)]
if len(li) == 9:
return li
else:
print("Your line was not valid, please try again.")
convert(input())
def create_board(bo):
for row in range(len(bo)):
print('Please enter the line below:')
board_list[row] = convert(input())
create_board(board_list)
print(board_list)
'''