We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fe2e736 + 7a1974c commit 69999f2Copy full SHA for 69999f2
Roadmap/20 - PETICIONES HTTP/python/annaviper.py
@@ -0,0 +1,18 @@
1
+import requests
2
+import pandas as pd
3
+
4
+BASE_URL = "https://pokeapi.co/api/v2/pokemon/"
5
+r = requests.get(BASE_URL + "jigglypuff")
6
7
+if str(r.status_code).startswith("2"):
8
+ data = r.json()
9
+ print(r.text)
10
+else:
11
+ raise
12
13
+print(f"Nombre: {data['name']}")
14
+print(f"ID: {data['id']}")
15
+print(f"Peso: {data['weight']}")
16
+print(f"Altura: {data['height']}")
17
+print(f"Tipo(s): {', '.join([i['type']['name'] for i in data['types']])}")
18
+print(f"Juegos(s): {', '.join([i['version']['name'] for i in data['game_indices']])}")
0 commit comments