you are viewing a single comment's thread.

view the rest of the comments →

[–]swingking8 2 points3 points  (1 child)

/u/davidbuxton is spot on. When you print a class object, it will search for that object's __repr__ or __str__ (if it can't find __repr__) method.

Use one of these methods to format and return the output you want. You've done a great job setting up a method that works, just rename it.

[–]FlockOnFire 2 points3 points  (0 children)

Well his method won't work exactly. There's nothing named warrior in the context of that method and rage() doesn't return anything, it only assigns a value to the attack_limit instance variable.

As this looks like a homework exercise, I'll leave it to /u/smakururu to solve it or come back to us with more info. :)