Im trying to use %d inside of a variable so it can change.
For example, when the variable is "horse1" the "1" can be changed to 2, 3, 4 etc. to make the variable "horse2, horse3, and horse4 etc.
This is a small line out of a long code that im trying to shorten
horseno = 1
horse1 = 4
if horse%d > 1 %(horseno):
print("nice")
What im trying to do is make it say this, but just in a way where i can change the horse number.
horseno = 1
horse1 = 4
if horse1 > 1:
print("nice")
However, when I run the first code shown, there is an error. Is there any way I can fix this?