Wednesday, July 24, 2019

Calendar Java and Python Part II

Lanjut ke Part 2, dengan menggunakan Bahasa Pemograman Python.

kalender = [('Januari',
range(1, 31+1)),
        ('Februari',
range(1, 28+1)),
        ('Maret',
range(1, 31+1)),
        ('April',
range(1, 30+1)),
        ('Mei',
range(1, 31+1)),
        ('Juni',
range(1, 30+1)),
        ('Juli',
range(1, 31+1)),
        ('Agustus',
range(1, 31+1)),
        ('September',
range(1, 30+1)),
        ('Oktober',
range(1, 31+1)),
        ('November',
range(1, 30+1)),
        ('Desember',
range(1, 31+1))]

minggu = ['Mo','Tu','We','Th','Fr','Sa','Su']

def klndr(tahun,awal_hari):
    pos_awal = minggu.index('Tu')

    if kabisat(tahun):
        kalender[1] = ('Februari', range(1,29+1))

    for bulan, days in kalender:
        print('{0}{1}'.format(bulan,tahun).center(20,' '))
        print('{0:
<3 100="" 1="" ahun="" asukkan="" days="" def="" end="" for="" format="" if="" in="" kabisat="" klnd

Terimakasih sudah menunggu😁

No comments:

Post a Comment

Business Communication

What is Business Communication?? Business Communication is all about presenting your ideas clearly and effectively. Ideas can be the im...