So this is my code:
if spot == 4:
exec("ch" + str(spot) + " = " + "vl" + str(spot) )
displayword.append(ch4)
else:
exec("ch" + str(spot) + " = " + "'_'")
displayword.append( ("ch"+str(spot) ))
My output on the word orange would be:
Orange ['ch0', 'ch1', 'ch2', 'ch3', ' g ', 'ch5']
So when I use displayword.append(ch4)
, I get the value of ch4 but when I just "ch" + str(spot)
I simply get that value as a string value.. I tried exec (("ch"+str(spot) ) )
, but I just got None
as the values in the list..