我正在尝试编写一个程序,该程序将接收输入、运行一些计算并将它们存储在列表中,然后再添加列表的元素。但我不断收到错误:wh_list = wh_list.append(wh) AttributeError: 'NoneType' object has no attribute 'append'
代码:
wh_list = []
u = len(wh_list)
if u <= 1:
while True:
inp = input("Y or N:")
B = int(input("B value:"))
C = int(input("C value:"))
D = int(input("D value:"))
wh = B * C * D
wh = int(wh)
wh_list = wh_list.append(wh)
if inp == "Y":
break
else:
Ewh = sum(wh_list)
print(Ewh)
交互式爱情
相关分类