data = [[1,0,0], [1,2,0], [1,0,2]] row = 0 taken = [] gameround = 0 invalidusage = "" invalidrange = "" while gameround < 9: rowchoice = int(input("Pick a row between 1 and 3 - ")) columnchoice = int(input("Pick a column between 1 and 3 - ")) chosensquare = (rowchoice + columnchoice) taken.append(chosensquare) count = taken.count(chosensquare) if count > 0 and gameround > 0: invalidusage = "yes" if chosensquare > 3 or chosensquare < 1: invalidrange = "yes" while invalidusage == "yes" and invalidrange == "yes": print("invalid") rowchoice = int(input("Pick a row between 1 and 3 - ")) columnchoice = int(input("Pick a column between 1 and 3 - ")) chosensquare = (rowchoice + columnchoice) taken.append(chosensquare) count = taken.count(chosensquare) if count > 0 and gameround > 0: invalidusage = "yes" if chosensquare > 3 or chosensquare < 1: invalidrange = "yes" while row < 3: col = 0 temp = "" while col < 3: if data[row][col] == 0: temp = temp + " " elif data[row][col] == 1: temp = temp + "X" else: temp = temp + "o" col = col + 1 print(temp) gameround = gameround + 1 row = row + 1