Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib, json
- url = "http://www.votopr2016.com/api"
- response = urllib.urlopen(url)
- data = json.loads(response.read())
- candidates = 0
- for countme in data["candidates"]:
- candidates = candidates + 1
- print("Nombre: " + data["candidates"][candidates - 1]["candidate_name"] + "\n" + "Votos: " + data["candidates"][candidates - 1]["candidate_votes"] + "\n------------------------------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement