Commit 74130437 by BellCodeEditor

save project

parent dc70412a
Showing with 25 additions and 0 deletions
def newinput():
a=[]
while True:
f=input("请输入:")
if f=="q":
break
else:
try:
f=int(f)
except:
print("数字")
else:
a.append(f)
finally:
print("_"*30)
return a
def sum(money):
count=0
for i in money:
count=count+i
return count
p=newinput()
w=sum(p)
print("一共消费"+str(w)+"元")
\ No newline at end of file
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