placesLeft = 9
def playerTurn():
  whereToGo = int(input("Where would you like to place your piece? "))
  while True:
    if whereToGo in row1:
      row1.insert(whereToGo - 1, "X")
      del row1[whereToGo]
      placesLeft = placesLeft - 1
playerTurn()
This isn't my full code obviously but the function is really big and I didn't think it was relevant to include. Is there something I'm missing with the scope laws in Python?
 
    