Commit 24985a68 by BellCodeEditor

auto save

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