Last active
April 18, 2020 06:20
-
-
Save blogcacanid/4f909a23fff3913eb42a8a8dd2d9051c to your computer and use it in GitHub Desktop.
covid19.py Sistem Informasi Covid-19 Python Menu Utama
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
from prettytable import PrettyTable | |
import json | |
def total_indonesia(): | |
print('*** TOTAL COVID-19 INDONESIA') | |
print('----------------------------------------') | |
print(f'Positif : ') | |
print(f'Sembuh : ') | |
print(f'Meninggal : ') | |
print('----------------------------------------') | |
def detail_indonesia(): | |
print('*** DETAIL COVID-19 INDONESIA') | |
def total_dunia(): | |
print('*** TOTAL COVID-19 DUNIA') | |
print('----------------------------------------') | |
print(f'Confirmed : ') | |
print(f'Recovered : ') | |
print(f'Deaths : ') | |
print('----------------------------------------') | |
def detail_dunia(): | |
print('*** DETAIL COVID-19 DUNIA') | |
def show_menu(): | |
print('========================================') | |
print('=== SISTEM INFORMASI COVID-19 PYTHON ===') | |
print('========================================') | |
print('1. Total Indonesia') | |
print('2. Detail Indonesia') | |
print('3. Total Dunia') | |
print('4. Detail Dunia') | |
print('0. Keluar') | |
print('----------------------------------------') | |
menu = input("Pilih menu > " ) | |
# clear screen | |
os.system("clear") | |
if menu == "1": | |
total_indonesia() | |
elif menu == "2": | |
detail_indonesia() | |
elif menu == "3": | |
total_dunia() | |
elif menu == "4": | |
detail_dunia() | |
elif menu == "0": | |
exit() | |
else: | |
print("Menu pilihan anda salah !!!!!") | |
print("Silahkan ulangi kembali ...") | |
if __name__ == "__main__": | |
while (True): | |
show_menu() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment