Task - 7 Write the PokemonExtra class so that the following code generates the output below: class PokemonBasic: OUTPUT: -Basic Info: init_(self, name = 'Default', hp = 0, = 'Unknown'): Name: Default,...


please solve in python language and use proper comments for better understanding. Thank You .


Task - 7<br>Write the PokemonExtra class so that the following code generates the output below:<br>class PokemonBasic:<br>OUTPUT:<br>-Basic Info:<br>init_(self, name = 'Default', hp = 0,<br>= 'Unknown'):<br>Name: Default, HP: 0, Weakness: None<br>Main type: Unknown<br>Basic move: Quick Attack<br>def<br>weakness = 'None', type<br>self.name = name<br>self.hit_point<br>hp<br>%3D<br>self.weakness = weakness<br>--Pokemon 1 Info:<br>Name: Charmander, HP: 39, Weakness: Water<br>Main type: Fire<br>Basic move: Quick Attack<br>self.type<br>type<br>%3D<br>def get_type(self):<br>return 'Main type:<br>+ self.type<br>-- Pokemon 2 Info:<br>Name: Charizard, HP: 78, Weakness: Water<br>Main type: Fire, Secondary type: Flying<br>Basic move: Quick Attack<br>Other move: Fire Spin, Fire Blaze<br>def get_move(self):<br>return 'Basic move:<br>+ 'Quick Attack'<br>def<br>str<br>(self):<br>+ self.name +<br>%3D<br>return

Extracted text: Task - 7 Write the PokemonExtra class so that the following code generates the output below: class PokemonBasic: OUTPUT: -Basic Info: init_(self, name = 'Default', hp = 0, = 'Unknown'): Name: Default, HP: 0, Weakness: None Main type: Unknown Basic move: Quick Attack def weakness = 'None', type self.name = name self.hit_point hp %3D self.weakness = weakness --Pokemon 1 Info: Name: Charmander, HP: 39, Weakness: Water Main type: Fire Basic move: Quick Attack self.type type %3D def get_type(self): return 'Main type: + self.type -- Pokemon 2 Info: Name: Charizard, HP: 78, Weakness: Water Main type: Fire, Secondary type: Flying Basic move: Quick Attack Other move: Fire Spin, Fire Blaze def get_move(self): return 'Basic move: + 'Quick Attack' def str (self): + self.name + %3D return "Name: HP: + str(self.hit_point) + ", Weakness: + self.weakness %3D %3D print('\n-- PokemonBasic() -Basic Info: ') pk print(pk) print(pk.get_type()) print(pk.get_move()) print('\n-- charmander = -- Pokemon 1 Info: PokemonExtra('Charmander', 39, 'Water', 'Fire') print(charmander) print(charmander.get_type()) print(charmander.get_move()) print('\n-- charizard = -Pokemon 2 Info:- PokemonExtra('Charizard', 78, 'Water', 'Fire', 'Flying', ('Fire Spin', 'Fire Blaze')) print (charizard) print(charizard.get_type()) print(charizard.get_move())

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here