-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Intermediategreat for learninggreat for learningenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Description
Refactor the code to use functions for better organization.
Current Behavior
All code is in the main function.
Expected Behavior
Split the code into logical functions.
Suggested Functions
fetch_pokemon_data(name)- Handle API callsdisplay_pokemon_info(data)- Handle display logicvalidate_input(name)- Validate user input
Implementation Steps
- Identify logical sections of the code
- Create functions for each section
- Move code into appropriate functions
- Update the main function to call these functions
- Test that everything still works
Skills Required
- Basic Python knowledge
- Understanding of functions
- Code organization skills
What You'll Learn
- Function design and organization
- Code refactoring
- Separation of concerns
Testing
Test that all functionality still works after refactoring:
python pokedex.py pikachupython pokedex.py fake-pokemonpython pokedex.py(no arguments)
Hints
- Start with one function at a time
- Make sure each function has a single responsibility
- Test after each function is created
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Intermediategreat for learninggreat for learningenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers