Commit 24985a68 by BellCodeEditor

auto save

parent 024fb164
Showing with 22 additions and 7 deletions
total = [] def h():
while True: d=[]
unit= input("请输入:") while True:
if unit== 'q': a=input("请输入价格")
if a=="q":
break break
else: else:
total.append(unit) try:
print(total) a=int(a)
\ No newline at end of file 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