Commit 643a38dc by BellCodeEditor

save project

parent ac73c069
Showing with 19 additions and 5 deletions
def t(): def newinput():
a=[] a=[]
while True: while True:
f=input("请输入:") f=input("请输入:")
if f=="q": if f=="q":
break break
else: else:
a.append() try:
print(f) f=int(f)
t() except:
\ No newline at end of file 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