Commit 24985a68 by BellCodeEditor

auto save

parent 024fb164
Showing with 24 additions and 9 deletions
total = [] def h():
while True: d=[]
unit= input("请输入:") while True:
if unit== 'q': a=input("请输入价格")
break if a=="q":
else: break
total.append(unit) else:
print(total) try:
\ No newline at end of file a=int(a)
except:
print("输入错误,请重新输入一个整数,不然我去偷你家马桶盖")
print("-"*60)
else:
d.append(a)
print("-"*50)
return d
def sum(monny):
bt=0
for i in monny:
bt=bt+i
return bt
b=h()
d=sum(b)
print("总价是"+str(d))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment