Skip to content

Instantly share code, notes, and snippets.

@blogcacanid
Created April 18, 2020 05:16
Show Gist options
  • Save blogcacanid/3a9662883e658beaf221a4a2a775fb46 to your computer and use it in GitHub Desktop.
Save blogcacanid/3a9662883e658beaf221a4a2a775fb46 to your computer and use it in GitHub Desktop.
covid19.py Sistem Informasi Covid-19 Python Total Dunia
def total_dunia():
print('*** TOTAL COVID-19 DUNIA')
print('----------------------------------------')
url = "https://api.kawalcorona.com/positif/"
data = requests.get(url).text
confirmed = json.loads(data)
print(f'Confirmed : {confirmed["value"]}')
url = "https://api.kawalcorona.com/sembuh/"
data = requests.get(url).text
recovered = json.loads(data)
print(f'Recovered : {recovered["value"]}')
url = "https://api.kawalcorona.com/meninggal/"
data = requests.get(url).text
deaths = json.loads(data)
print(f'Deaths : {deaths["value"]}')
print('----------------------------------------')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment