Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
583 B
0
Indexable
Never
def tambah(aab, baa):
	return aab + baa

def kurang(aab, baa):
	return aab - baa

def kali(aab, baa):
	return aab * baa

def bagi(aab, baa):
	return aab / baa


print("Menu Kalkulator:\n1. Tambah\n2. Kurang\n3. Kali\n4. Bagi\n5. Exit")

select = input("Pilih Menu :")
if select != "5":
	aab = int(input("Masukkan Angka Pertama :"))
	baa = int(input("Masukkan Angka Kedua :"))

match select:
	case "1":
		print(tambah(aab, baa))
	case "2":
		print(kurang(aab, baa))
	case "3":
		print(kali(aab, baa))
	case "4":
		print(bagi(aab, baa))
	case "5":
		exit()
	case _:
		print("Invalid")