Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ahmad Dzikrul Fikri
1806196806-DDP1
Commits
6228baa6
Commit
6228baa6
authored
Mar 02, 2020
by
Ahmad Dzikrul Fikri
Browse files
Tugas Pemrograman 5 - Tahap 2 - 1806196806
parent
d4ca6691
Changes
1
Hide whitespace changes
Inline
Side-by-side
TP5_1806196806.py
View file @
6228baa6
...
...
@@ -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
(
"
\n
Sedang meminta kak burhan restock tabung gas
\n
"
)
request_stok
()
stok
=
int
(
ambil_info_stok
())
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment