Source Code
print "-- MENU PYTHON --"
print "1. BIODATA"
print "2. NAMA BULAN"
print "3. SEGITIGA SIKU BINTANG"
print "4. KALKULATOR"
print "5. SUBSTRING"
print "-----------------"
pilih = input ("MASUKKAN PILIHAN : ")
if pilih == 1:
print "\n BIODATA \n"
nama = raw_input ("Nama Lengkap : ")
sekolah = raw_input ("Sekolah/Universitas : ")
kelas = raw_input ("Kelas : ")
jurusan = raw_input ("Jurusan : ")
print "\n\nBiodata Saya"
print "Nama Saya",nama, ". Saya sedang belajar di",sekolah, "kelas",kelas, "dan jurusan",jurusan
elif pilih == 2:
print "\n NAMA BULAN \n"
bulan = int (raw_input ("Masukkan Bulan Ke - "))
nama2 = {1: "Januari", 2: "Februari", 3: "Maret", 4: "April", 5: "Mei", 6: "Juni",
7: "Juli", 8: "Agustus", 9: "September", 10: "Oktober", 11: "November", 12: "Desember"}
print "Bulan Ke - ",bulan, "Adalah Bulan ",nama2[bulan]
elif pilih == 3:
print "\n BINTANG \n"
bintang = int (raw_input ("Masukkan Tinggi : "))
bintang +=1
for i in range (0, bintang, 1):
for j in range (0, i, 1):
print "*",
print ""
print "\n"
elif pilih == 4:
print "\n KALKULATOR \n"
a = float (raw_input ("A : "))
b = float (raw_input ("B : "))
print "Penjumlahan : ",a+b
print "Pengurangan : ",a-b
print "Perkalian : ",a*b
print "Pembagian : ",a/b
elif pilih == 5:
print "\n SUBSTRING \n"
c = raw_input ("String : ")
print
print c[0]
print c[0:3]
print c[0:5]
else:
exit
print "-- MENU PYTHON --"
print "1. BIODATA"
print "2. NAMA BULAN"
print "3. SEGITIGA SIKU BINTANG"
print "4. KALKULATOR"
print "5. SUBSTRING"
print "-----------------"
pilih = input ("MASUKKAN PILIHAN : ")
if pilih == 1:
print "\n BIODATA \n"
nama = raw_input ("Nama Lengkap : ")
sekolah = raw_input ("Sekolah/Universitas : ")
kelas = raw_input ("Kelas : ")
jurusan = raw_input ("Jurusan : ")
print "\n\nBiodata Saya"
print "Nama Saya",nama, ". Saya sedang belajar di",sekolah, "kelas",kelas, "dan jurusan",jurusan
elif pilih == 2:
print "\n NAMA BULAN \n"
bulan = int (raw_input ("Masukkan Bulan Ke - "))
nama2 = {1: "Januari", 2: "Februari", 3: "Maret", 4: "April", 5: "Mei", 6: "Juni",
7: "Juli", 8: "Agustus", 9: "September", 10: "Oktober", 11: "November", 12: "Desember"}
print "Bulan Ke - ",bulan, "Adalah Bulan ",nama2[bulan]
elif pilih == 3:
print "\n BINTANG \n"
bintang = int (raw_input ("Masukkan Tinggi : "))
bintang +=1
for i in range (0, bintang, 1):
for j in range (0, i, 1):
print "*",
print ""
print "\n"
elif pilih == 4:
print "\n KALKULATOR \n"
a = float (raw_input ("A : "))
b = float (raw_input ("B : "))
print "Penjumlahan : ",a+b
print "Pengurangan : ",a-b
print "Perkalian : ",a*b
print "Pembagian : ",a/b
elif pilih == 5:
print "\n SUBSTRING \n"
c = raw_input ("String : ")
print c[0]
print c[0:3]
print c[0:5]
else:
exit
0 comments:
Posting Komentar