Commit 3eb29331 by BellCodeEditor

save project

parent dc70412a
Showing with 25 additions and 0 deletions
def ysmjfood():
toda=[]
while True:
foo=input("请输入,按q退出")
if foo=="q":
break
else:
try:
foo=int(foo)
except:
print("输入的不是整数")
else:
toda.append(foo)
return toda
def sum(money):
ys=0
for i in money:
ys=ys+i
return ys
hh=ysmjfood()
pay=sum(hh)
print("您一共花费了"+str(pay)+"元")
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