# Need help with a calculator programme that keeps repeating itself halfway but doesn't show error

Hello, the coding below is a calculator for power and roots of number. Some of the stuff is written in my native language so don’t mind it. The issue that I’m facing is that at the noPilihan=input(…) . After the user to inputs a number, it will keep repeating from print(“kalkulator Bermenu.”)until noPilihan=input(…) . I would like to ask for some guidance on how to fix my code?

``````def menu():
print("1. Operasi kuasa")
print("2. Punca kuasa")
print("3. Tamat")

def dptPilihanPengguna():
noPilihan=0
while (noPilihan<1) or (noPilihan>3):
noPilihan=int(input("Pilihan anda [1 hingga 3]: "))
return noPilihan

def dptDuaNombor():
n1=int(input("Masukkan nombor pertama: "))
n2=int(input("Masukkan nombor kedua: "))
return n1,n2

def kiraCetak(jenisOperator, a, b):
if jenisOperator ==1:
print("Output: "+ str(a) + "*"+ str(b) + "=" + str(a**b) +"\n")
elif jenisOperator ==2:
print("Output: "+ str(a) + "√" + str(b) + "=" +str(a**1/b))

aktif=1
while aktif ==1:
jenisOperasi = dptPilihanPengguna()
if jenisOperasi == 3:
aktif = 0
else:
[n1,n2]=dptDuaNombor()
print(kiraCetak(jenisOperasi,n1,n2))
print("Terima kasih kerana menggunakan saya.")
``````

Output:

1. Operasi kuasa
2. Punca kuasa
3. Tamat
Pilihan anda [1 hingga 3]: 1
You have an indentation problem. The `if` clause at the end of the script should be inside the `while` loop.