Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Lyric Abbott
35,595 Pointscant complete
Create a new class named Warrior that extends Character from character.py. Use pass to make an empty class.
3 Answers
Kenneth Love
Treehouse Guest TeacherCan you show us the code you're trying so we can know where you need help?
Devin Scheu
66,191 PointsIm having trouble with task 3 of this challenge :/
Make a new Warrior method called rage that sets attack_limit to 20.
from character import Character
class Warrior(Character):
weapon = "sword"
pass
Kenneth Love
Treehouse Guest TeacherOK, what part has you confused? You need to add a method to the class. Methods are functions that are indented inside of a class. They take self as their first argument. Then, in that method, you need to change the instance's attack_limit to 20.
Devin Scheu
66,191 Pointsthe istances
Kenneth Love
Treehouse Guest Teacherself always refers to the instance that the method is being called on.
Devin Scheu
66,191 PointsThnx. I get it :)
peter hampton
18,068 Pointspeter hampton
18,068 PointsMaybe you forgot to import the Character class from character.py?