Skip to content

Commit

Permalink
Reto mouredev#10 - Python
Browse files Browse the repository at this point in the history
  • Loading branch information
rokmanhaman committed Nov 17, 2023
1 parent 4ccdc1d commit dbdfeda
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Retos/Reto #10 - LA API [Media]/python/rokmanhaman.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
Reto #10: LA API
/*
* Llamar a una API es una de las tareas más comunes en programación.
*
* Implementa una llamada HTTP a una API (la que tú quieras) y muestra su
* resultado a través de la terminal. Por ejemplo: Pokémon, Marvel...
*
* Aquí tienes un listado de posibles APIs:
* https://github.com/public-apis/public-apis
*/
"""

import requests

url = "https://www.fruityvice.com/api/fruit/all"


response = requests.get(url)


for fruit in response.json():
print(f"{fruit['name']} --- {fruit['family']}")

0 comments on commit dbdfeda

Please sign in to comment.