Aug-15-2019, 02:17 PM
Can someone please suggest what is wrong with the code so the 'player 2 make your suggestion' is show
turn = 0 invalid = True game_over = False def board_create(): board = [[' '] * column for row in range(row)] def is_valid_location(): if (column-1) < column_choice < (column+1): invalid = False return invalid else: invalid = True return invalid row = int(input("How many rows: ")) column = int(input("How many columns: ")) board = board_create() while not game_over: if turn == 0: while invalid == True: column = str(column) column_choice = int(input("Player 1 make your selection (1-"+column+"):")) column = int(column) is_valid_location() else: while invalid == True: column = str(column) column_choice = int(input("Player 2 make your selection (1-"+column+"):")) column = int(column) is_valid_location() turn = turn + 1 turn = turn % 2