python: def pokehelp(poke_name, stat_min): """ Question 4 - API You are looking for a Pokemon that can help you with your programming homework. Since Porygon is made of code, you decide to look into the species. Using the given API, return a dictionary that returns the name of each of Porygon's stats with a base stat GREATER THAN the given number, mapped to their value. Do not hardcode Porygon's stats into the results! It is not the only test case. Base URL: https://pokeapi.co/ Endpoint: api/v2/pokemon/{poke_name} Args: Pokemon name (str), stat minimum (int) Returns: Dictonary of stats >>> pokehelp("porygon", 65) {'defense': 70, 'special-attack': 85, 'special-defense': 75} >>> pokehelp("koraidon", 100) {'attack': 135, 'defense': 115, 'speed': 135} """ # pprint(pokehelp("porygon", 65)) # pprint(pokehelp("koraidon", 100))
python:
def pokehelp(poke_name, stat_min):
"""
Question 4 - API
You are looking for a Pokemon that can help you with
your programming homework. Since Porygon is made of code,
you decide to look into the species. Using the given API, return
a dictionary that returns the name of each of Porygon's stats
with a base stat GREATER THAN the given number, mapped to their value.
Do not hardcode Porygon's stats into the results!
It is not the only test case.
Base URL: https://pokeapi.co/
Endpoint: api/v2/pokemon/{poke_name}
Args:
Pokemon name (str), stat minimum (int)
Returns:
Dictonary of stats
>>> pokehelp("porygon", 65)
{'defense': 70, 'special-attack': 85, 'special-defense': 75}
>>> pokehelp("koraidon", 100)
{'attack': 135, 'defense': 115, 'speed': 135}
"""
# pprint(pokehelp("porygon", 65))
# pprint(pokehelp("koraidon", 100))

Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images









