TPayneExperience / 009_016_LLP_Solutions

Solutions for LLP: Tutorials #9-16
5 stars 4 forks source link

Do not get the solution on Nº10 course #2

Open ThetaOptimus opened 6 years ago

ThetaOptimus commented 6 years ago

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()

sjeff002 commented 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?

TPayneExperience commented 6 years ago

^^ Whoops, replied on my Fiancee's account ^^