- Programming Language: Python (or your preferred language)
- Libraries allowed: requests, json
Problem Statement:
Write a function called get_pokemon_name
that takes a Pokemon ID and returns the name of the Pokemon.
def get_pokemon_name(pokemon_id: int) -> str:
pass
Problem Statement:
Given a Pokemon name, write a function called get_pokemon_info
to retrieve the following details:
- Name
- Base experience
- Height
- Weight
The function should return a dictionary.
def get_pokemon_info(pokemon_name: str) -> dict:
pass
Problem Statement:
Some Pokemon have multiple types (e.g., Water, Grass). Write a function called get_pokemon_types
that retrieves all types for a given Pokemon.
def get_pokemon_types(pokemon_name: str) -> list:
pass
Problem Statement:
Pokemons evolve from one form to another. Write a function called get_evolution_chain
that retrieves the entire evolution chain for a given Pokemon.
Hint: You might need to explore the evolution-chain endpoint.
def get_evolution_chain(pokemon_name: str) -> list:
pass
Problem Statement:
Given a type of Pokemon (e.g., 'Water'), write a function called average_base_experience
to calculate the average base experience for all Pokemon of that type.
def average_base_experience(pokemon_type: str) -> float:
pass
Problem Statement:
Write a function called filter_pokemon
that retrieves all Pokemon below a given height and weight and sorts them by their base experience in descending order.
def filter_pokemon(height: int, weight: int) -> list:
pass
Problem Statement:
Fetching each Pokemon's details sequentially can be time-consuming. Write an asynchronous function called async_get_pokemon_details
that takes in a list of Pokemon names and retrieves their details concurrently.
You might want to use asyncio
and aiohttp
for this task.
async def async_get_pokemon_details(pokemon_names: list) -> list:
pass
Working thru things here: https://replit.com/@jonathanhle/DimpledDramaticLevel#main.py