Fakultas Ilmu Komputer UI

TP3_2_1906399915.py 940 Bytes
Newer Older
Ruly Achmad Gemilang Gultom's avatar
Ruly Achmad Gemilang Gultom committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import urllib.request

page = urllib.request.urlopen("https://skycruiser8.github.io/PF1Demo/")
datas = page.read().decode("utf8")

datas = datas.split("\n")
index = 0
print(datas)

while index < len(datas)-1:
    nama_agen = datas[index]
    permintaan_kuota = int(datas[index+1])
    if nama_agen[:8] == "Koperasi":
        tipe_perusahaan = "koperasi"
        kuota_maks = 15000
    else:
        tipe_perusahaan = "PT."
        kuota_maks = 20000
    
    if permintaan_kuota > kuota_maks:
        print(nama_agen," melebihi kuota maks", kuota_maks,"tabung")
    else:
        if permintaan_kuota > 0.75*kuota_maks:
            print(nama_agen," adalah agen",tipe_perusahaan," Kelas I")
        else:
            if permintaan_kuota > 0.5*kuota_maks:
                print(nama_agen,"adalah agen",tipe_perusahaan," kelas J")
            else:
                print(nama_agen,"adalah agen",tipe_perusahaan," kelas K")
    index = index+2