Rearrange part of your code like that (the rest is OK)
try: squareChoice = int(input("Choose a square!")) -1 except ValueError: print("\nAnswer is not a number! please enter a valid number!") continue
if boardValues[squareChoice] != "X" and boardValues[squareChoice] != "O"may be re-written as
if boardValues[squareChoice] not in "OX":
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.