Skip to content

[Good First Issue] Display Pokémon's Abilities #2

@SthembisoMfusi

Description

@SthembisoMfusi

Description

Add Pokémon abilities to the display output.

Current Behavior

PyDex doesn't show Pokémon abilities.

Expected Behavior

Display all abilities for the Pokémon, including hidden abilities.

Example Output

Name: Pikachu
National Pokédex Number: 25
Type(s): Electric
Abilities: Static, Lightning Rod (hidden)

Implementation Steps

  1. Find the abilities array in the JSON response
  2. Loop through the abilities and extract the ability names
  3. Check if an ability is hidden (look for is_hidden: true)
  4. Format the output nicely

Skills Required

  • Basic Python knowledge
  • Understanding of loops and lists
  • Working with JSON data

What You'll Learn

  • Iterating through arrays in JSON
  • Conditional logic in Python
  • String formatting and concatenation

Testing

Test with these Pokémon:

  • python pokedex.py pikachu (has hidden ability)
  • python pokedex.py charizard (multiple abilities)
  • python pokedex.py ditto (simple ability)

Hints

  • Look for data['abilities'] in the JSON response
  • Each ability has a name and is_hidden property
  • Use a loop to go through all abilities

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions