Aug-16-2019, 09:40 AM
I have emended the code as appropriate but I'm still stuck in the loop:
turn = 0 game_over = False def board_create(column, row): board = [[' '] * column for row in range(row)] return board def is_valid_location(column_choice, invalid): if (column-1) < column_choice < (column+1): return False, column_choice, invalid else: return True, column_choice, invalid row = int(input("How many rows: ")) column = int(input("How many columns: ")) board = board_create(column, row) while not game_over: if turn == 0: invalid = True while invalid == True: column = str(column) column_choice = int(input("Player 1 make your selection (1-"+column+"):")) column = int(column) invalid = is_valid_location(column_choice, invalid) else: while invalid == True: column = str(column) column_choice = int(input("Player 2 make your selection (1-"+column+"):")) column = int(column) invalid = is_valid_location(column_choice, invalid) turn = turn + 1 turn = turn % 2