【发布时间】:2018-05-17 07:26:41
【问题描述】:
在输入为TypeError: 'int' object is not callable 后,我无法让该程序正常运行所有它返回的内容
#!/usr/bin/python3
def displaymenu():
input32=int(input("1) Run experiment\n2) Exit"))
return input32
def cal1(we,woc,wa):
wala=we*woc(wa-woc)
return wala
def cal2(wo,woh):
wolo=24*wo*woh*wa
return wolo
def cal3(wa,woc):
wele=wa**2+woc(wa-woc)
return wele
def beamere(wala,wolo,wele):
y=(wala/wolo)*wele
return y
input32 = displaymenu()
while input32 is not 2:
if input32 == 1:
we= int(input("enter your width"))
wo= int(input("enter what ever this is"))
woh=int(input("enter this thing"))
wa= int(input("i really should stop calling my varibles random sylibles"))
woc=int(input("enter your woc"))
wala = cal1(we,woc,wa)
wolo = cal2(wo,woh)
wele = cal3(wa,woc)
y = beamere(wala,wolo,wele)
print(y)
elif input32 == 2:
print("learn english")
break
else:
input32 = displaymenu()
【问题讨论】:
-
woc(wa-woc)是一个函数调用,而不是乘法。是的,你不应该使用如此糟糕的变量名,但也许可以修复它而不是将其包含在提示中。
标签: python python-3.x