Open ThetaOptimus opened 6 years ago
hmm. looks like you could be missing a couple Supers in your inheriting classes (Friendly, enemy) that would replace your 'self.name =...' lines
what errors are you getting?
^^ Whoops, replied on my Fiancee's account ^^
Hey TP, your course is great. I can not understand the solution since the last point is to print. Do not see anything printed. Am I doing ok?
class BaseCharacter(object): def init(self, name, arma): self.name = name self.arma = arma def printName(self): print(self.name) def printArma(self): print(self.arma)
class NPC(BaseCharacter): def init(self, name, arma): super(NPC, self).init(name, arma)
class Friendly(NPC): def init(self, name, arma): self.name = name self.arma = arma
class Enemy(NPC): def init(self, name, arma): self.name = name self.arma = arma
fnpc = NPC('Amigo NPC', 'Pluma') fnpc.printName() fnpc.printArma()
enpc = NPC('Enemigo NPC', 'Pistola') enpc.printName() enpc.printArma()