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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 2CP
icon
Related questions
Question

Solve using Python3 and inheritance method

Task - 7
Write the PokemonExtra class so that the following code generates the output below:
class PokemonBasic:
OUTPUT:
---Basic Info:--
def _init_(self, name = 'Default', hp = 0,
weakness = 'None', type =
Name: Default, HP: 0, Weakness: None
Main type: Unknown
Basic move: Quick Attack
'Unknown'):
self.name = name
self.hit_point = hp
self.weakness = weakness
self.type = type
--Pokemon 1 Info: --
Name: Charmander, HP: 39, Weakness: Water
Main type: Fire
Basic move: Quick Attack
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):
return "Name:
+ self.name + ", HP: " +
str(self.hit_point) + ", Weakness: " + self.weakness
-- Basic Info: -
print('\n-------
pk = PokemonBasic()
print(pk)
print(pk.get_type())
print(pk.get_move())
-')
print ('\n--
charmander = PokemonExtra('Charmander', 39, 'Water',
'Fire')
print(charmander)
print(charmander.get_type())
print(charmander.get_move())
- Pokemon 1 Info:--
-----
- Pokemon 2 Info:---
print('\n---
charizard = PokemonExtra('Charizard', 78, 'Water',
'Fire', 'Flying', ('Fire Spin', 'Fire Blaze'))
print(charizard)
print(charizard.get_type())
print(charizard.get_move())
Transcribed Image Text:Task - 7 Write the PokemonExtra class so that the following code generates the output below: class PokemonBasic: OUTPUT: ---Basic Info:-- def _init_(self, name = 'Default', hp = 0, weakness = 'None', type = Name: Default, HP: 0, Weakness: None Main type: Unknown Basic move: Quick Attack 'Unknown'): self.name = name self.hit_point = hp self.weakness = weakness self.type = type --Pokemon 1 Info: -- Name: Charmander, HP: 39, Weakness: Water Main type: Fire Basic move: Quick Attack 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): return "Name: + self.name + ", HP: " + str(self.hit_point) + ", Weakness: " + self.weakness -- Basic Info: - print('\n------- pk = PokemonBasic() print(pk) print(pk.get_type()) print(pk.get_move()) -') print ('\n-- charmander = PokemonExtra('Charmander', 39, 'Water', 'Fire') print(charmander) print(charmander.get_type()) print(charmander.get_move()) - Pokemon 1 Info:-- ----- - Pokemon 2 Info:--- print('\n--- charizard = PokemonExtra('Charizard', 78, 'Water', 'Fire', 'Flying', ('Fire Spin', 'Fire Blaze')) print(charizard) print(charizard.get_type()) print(charizard.get_move())
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage