print( "proses", ops, " kalimat ", kalimat, " adalah :",h)
def uppercase(kalimat,ops):
str=kalimat.upper();
cetak(kalimat,str,ops)
def lowercase(kalimat,ops):
str=kalimat.lower();
cetak(kalimat,str,ops)
def last(kalimat,ops):
p=len(kalimat)
str=kalimat[p-1];
cetak(kalimat,str,ops)
def first(kalimat,ops):
str=kalimat[0];
cetak(kalimat,str,ops)
def replace(kalimat,ops):
y=input("masukan huruf")
z=input("masukan huruf")
str=kalimat.replace(y,z);
cetak(kalimat,str,ops)
def reverse(kalimat,ops):
balikan = kalimat[::-1]
cetak(kalimat,balikan,ops)
def indexof(kalimat,ops):
str=kalimat.find('a');
cetak(kalimat,str,ops)
def gabung(kalimat,ops):
y=input("masukan kalimat")
str= kalimat + ' ' + y;
cetak(kalimat,str,ops)
def mulai():
kalimat=str(input("masukan kalimat:"))
print("Silakan pilih ops?")
print(" 1) uppercase")
print(" 2) lowercase")
print(" 3) last")
print(" 4) first")
print(" 5) replace")
print(" 6) reverse")
print(" 7) indexof")
print(" 8) gabung" )
pil=int(input("masukan pilihan anda"))
if pil==1:
uppercase(kalimat,"uppercase")
elif pil==2:
lowercase(kalimat,"lowercase")
elif pil==3:
last(kalimat,"last")
elif pil==4:
first(kalimat,"first")
elif pil==5:
replace(kalimat,"replace")
elif pil==6:
reverse(kalimat,"reverse")
elif pil==7:
indexof(kalimat,"indexof")
elif pil==8:
gabung(kalimat, "gabung")
else:
print("tidak ada dalam opearasi")
print("apakah anda ingin melanjutkan operasi?")
print(" 1) lanjut")
print(" 2) keluar")
pil=int(input("Pilihan"))
if pil==1:
mulai()
else:
print("terimakasih")
print("*****************************************")
print(" Latihan Python 2 ")
print("*****************************************")
mulai()