**PlayerAnswer = easygui.enterbox ("What is" +Figure1+ "+" +Figure2+ "?")**
This line of code is not reading, both Figure1 and Figure2 are definded as random variables, random is imported.
here is how I've defined it at the top of the coding:
**Figure1 = random.randrange(0,11)
Figure2 = random.randrange(0,11)**
The error I get back is:
**PlayerAnswer = easygui.enterbox ("What is" +Figure1+ "+" +Figure2+ "?")
TypeError: cannot concatenate 'str' and 'int' objects**
Here is the coding in context:
**for number in range(0,11):
PlayerAnswer = easygui.enterbox ("What is" +Figure1+ "+" +Figure2+ "?")
if PlayerAnswer ==(Figure1 + Figure2):
AdditionAnswers += 1
easygui.msgbox ("Correct! Your score is "+str(AdditionAnswers))**
Aucun commentaire:
Enregistrer un commentaire