Task – 9 Implement the design of the Pikachu and Charmander classes that are derived from the Pokemon class so that the following output is produced: Driver Code Output class Pokemon: Pokemon: Pikachu...


Solve using Python3 and Inheritance method


Task – 9<br>Implement the design of the Pikachu and Charmander classes that are derived from<br>the Pokemon class so that the following output is produced:<br>Driver Code<br>Output<br>class Pokemon:<br>Pokemon: Pikachu<br>Туре: Electric<br>def _init_(self, p):<br>self.pokemon = p<br>self.pokemon_type =

Extracted text: Task – 9 Implement the design of the Pikachu and Charmander classes that are derived from the Pokemon class so that the following output is produced: Driver Code Output class Pokemon: Pokemon: Pikachu Туре: Electric def _init_(self, p): self.pokemon = p self.pokemon_type = "Needs to be set" self.pokemon_weakness = "Needs to be set" def kind(self): return self.pokemon_type def weakness(self): return self.pokemon_weakness def what_am_i(self): print("I am a Pokemon.") Weakness: Ground I am a Pokemon. I am Pikachu. Pokemon: Charmander Туре: Fire Weakness: Water, Ground and Rock I am a Pokemon. I am Charmander. pk1 = Pikachu() print("Pokemon:", pk1.pokemon) print("Type:", pk1.kind()) print("Weakness:", pk1.weakness()) pk1.what_am_i() print ("=======: c1 = Charmander() print ("Pokemon:", c1.pokemon) print ("Type:", c1.kind()) print ("Weakness:", c1.weakness()) c1. what_am_i() =")

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here