I have my for loop set up, but im missing one condition and just don't know where to put it! Let's say the user already picked "a1" and picks it again. I don't want that value to be used but instead tell him it's already been picked and let him pick again. I tried making it but the way I had it, it told him that he already picked it, but didn't let him go again.
def inputCoordinate():
coordinate = False
while not coordinate :
user = (input("Enter your move: "))
if user in List:
if user == "a1":
value = "O"
gameboard[0] = value
playedmoves.append("a1")
elif user == "a2":
value = "O"
gameboard[3] = value
playedmoves.append("a2")
elif user == "a3":
value = "O"
gameboard [6] = value
playedmoves.append("a3")
elif user == "b1":
value = "O"
gameboard[1] = value
playedmoves.append("b1")
elif user =="b2":
value = "O"
gameboard[4] = value
playedmoves.append("b2")
elif user == "b3":
value = "O"
gameboard[7] = value
playedmoves.append("b3")
elif user =="c1":
value = "O"
gameboard[2]=value
playedmoves.append("c1")
elif user == "c2":
value = "O"
gameboard[5] = value
playedmoves.append("c2")
elif user == ("c3"):
value = "O"
gameboard[8] = value
playedmoves.append("c3")
else:
print("invalid Coordinates")
continue
return value
playedmoves =("a1","b2")
List = ("a1", "a2", "a3", "b1", "b2", "b3", "c1", "c2", "c3")