Outils logiciels pour les cours Paris II
Cours Paris II
Stages/ Thèses/ Séminaires |
Python 1
import requests import json dct = {"1": "a", "3": "b", "8": {"12": "c", "25": "d"}} for key in dct.keys(): print(key, dct[key])
import requests import json dct = {"1": "a", "3": "b", "8": {"12": "c", "25": "d"}} print(dct["8"] ["12"])
import requests import json r = requests.get('https://api.coindesk.com/v1/bpi/currentprice.json') bitcoin_data = dict(r.json()) bitcoin_value = bitcoin_data["bpi"]["USD"]["rate_float"] print("Actual Bitcoin pricing ", bitcoin_value, "$") |