print("--------------------")
print("UJIAN AP2B")
print("Nama : Muhammad reza hidayat")
print("Kelas : 1IA16")
print("NPM : 50420900")
print("--------------------")
def menu():
print('\n========PROGRAM MENU========')
print('1. Biodata')
print('2. Nilai')
print('3. Program Kalkulator')
print('4. Keluar')
print('=============================')
pil = int(input('Masukkan pilihan anda: '))
print('=============================')
if pil == 1:
bio()
menu()
elif pil == 2:
nilai()
menu()
elif pil == 3:
kal()
menu()
elif pil == 4:
exit()
else:
print('Input yang anda masukkan salah! Coba lagi.')
menu()
def bio():
nama = input("Masukkan Nama: ")
npm = input("Masukkan NPM: ")
kls = input("Masukkan Kelas: ")
print('=====================================')
print('saya',nama)
print('npm saya',npm)
print('saya dari kelas',kls)
def nilai():
uts = int(input("Masukkan Nilai UTS: "))
uas = int(input("Masukkan Nilai UAS: "))
jml = (uts * 0.4) + (uas * 0.6)
print("Nilai UTS saya ",uts)
print("Nilai UAS saya ",uas)
print("Total Nilai saya", jml)
def kal():
a = int(input('Masukkan angka ke-1 : '))
b = int(input('Masukkan angka ke-2 : '))
c = a + b
d = a - b
e = a * b
f = a / b
print(a, '+', b, '=', c)
print(a, '-', b, '=', d)
print(a, 'x', b, '=', e)
print(a, ':', b, '=', f)
menu()
Like this:
Like Loading...
Related