I am not TK expert but: If you execute apply() before body(), self.answernum is not defined yet.
apply()
body()
self.answernum