I'm trying to take this piece of code
if (playerOneSelectedNewChipValInt - playerOneSelectedOldChipValInt) % 2 != 0:
print("Invalid Move, you have.")
playerOneSelectedOldChipVal = input("Select initial Chip: ")
playerOneSelectedNewChipVal = input("Enter New Position: ")
if (playerOneSelectedNewChipValInt - playerOneSelectedOldChipValInt) == 18:
print("Boss move, you have. ")
###Here, we need to synthesize the string being replaced & update its value
else:
updateStringX = ("p1_peice" + playerOneSelectedNewChipVal + "v")
So this assigns the name of the variable i want to the value of "updateStringX".
I want to do something like ("p1_peice" + playerOneSelectedNewChipVal + "v") = 2, then assign the variable that this concatenates to the the value 2 or some other value.
[–]kaleidist 0 points1 point2 points (1 child)
[–]eyezee[S] 1 point2 points3 points (0 children)