Fakultas Ilmu Komputer UI

Commit 6228baa6 authored by Ahmad Dzikrul Fikri's avatar Ahmad Dzikrul Fikri
Browse files

Tugas Pemrograman 5 - Tahap 2 - 1806196806

parent d4ca6691
......@@ -10,6 +10,9 @@ def laporkan_stok(stok_sekarang):
param = urllib.parse.urlencode({"pesan":stok_sekarang})
resp= urllib.request.urlopen("https://ceritanyatuwiter.herokuapp.com/1806196806/lapor",param.encode())
def request_stok():
laporkan_stok("@burhan request restock untuk saya")
stok = int(ambil_info_stok())
disalurkan = 1
while stok>0 and disalurkan >0:
......@@ -20,4 +23,7 @@ while stok>0 and disalurkan >0:
else:
print("Penyaluran",disalurkan,"tabung berhasil, sekarang tersisa",stok-disalurkan)
laporkan_stok("Stok Terkini: "+str(stok-disalurkan))
stok = int(ambil_info_stok())
\ No newline at end of file
if stok - disalurkan == 0 :
print("\nSedang meminta kak burhan restock tabung gas\n")
request_stok()
stok = int(ambil_info_stok())
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment