İç içe oluşturulan bir fonksiyonda içerideki fonksiyonu parantezleri olmadan çağırdığımda neden doğru çalışıyor?
Örnek Kod:
def sarmala(current_v):
def calculate():
global content, v, operator
if type(current_v) == int and content.get() != "NAND":
content.set(content.get() + str(current_v))
elif current_v == "." and content.get().find(".") == -1 and content.get() != "NAND":
content.set(content.get() + current_v)
elif current_v == "C":
content.set("")
elif current_v == "=" and content.get() != "NAND":
if operator == "+" and content.get() != "":
total = float(v) + float(content.get())
content.set(total)
if operator == "-" and content.get() != "":
total = float(v) - float(content.get())
content.set(total)
if operator == "/" and content.get() != "":
if float(content.get()) == 0:
content.set("NAND")
else:
total = float(v) / float(content.get())
content.set(total)
if operator == "*" and content.get() != "":
total = float(v) * float(content.get())
content.set(total)
else :
if content.get() != "" and content.get() != "NAND":
v = float(content.get())
content.set("")
operator = current_v
else:
pass
return calculate