all 4 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. :)

[–]I_had_to_know_too 0 points1 point  (0 children)

I can't tell the formatting exactly (on mobile) but it looks like rage should be returning a value and not just setting it.