Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python

Write the PokemonExtra class so that the following code generates the output below:

class PokemonBasic:
 def __init__(self, name = 'Default', hp = 0, 
weakness = 'None', type = 'Unknown'):
 self.name = name
 self.hit_point = hp
 self.weakness = weakness
 self.type = type
 def get_type(self):
 return 'Main type: ' + self.type
 def get_move(self):
 return 'Basic move: ' + 'Quick Attack'
 def __str__(self):
 return "Name: " + self.name + ", HP: " + 
str(self.hit_point) + ", Weakness: " + self.weakness
print('\n------------Basic Info:--------------')
pk = PokemonBasic()
print(pk)
print(pk.get_type())
print(pk.get_move())
print('\n------------Pokemon 1 Info:-------------')
charmander = PokemonExtra('Charmander', 39, 'Water', 
'Fire')
print(charmander)
print(charmander.get_type())
print(charmander.get_move())
print('\n------------Pokemon 2 Info:-------------')
charizard = PokemonExtra('Charizard', 78, 'Water', 
'Fire', 'Flying', ('Fire Spin', 'Fire Blaze'))
print(charizard)
print(charizard.get_type())
print(charizard.get_move())

[MOD: added ```python formatting -cf]