I\'m trying to create a program and one thing I\'m trying to do is add variables to a string like so.
EnemyHealth = 0
EnemyIs = \'dead\'
print(\"The Enem
Avoid % format specifiers in Python3.x
From the Docs :
old style of formatting will eventually be removed from the language, str.format() should generally be used.
There are few simple ways to do this, check below code :
print("The Enemy's health is {} The Enemy is {}".format(EnemyHealth, EnemyIs)
print("The Enemy's health is {0} The Enemy is {1}".format(EnemyHealth, EnemyIs)
print("The Enemy's health is {EnemyHealth} The Enemy is {EnemyIs}".format(EnemyHealth=EnemyHealth, EnemyIs=EnemyIs)