Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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]