Commit d25f0c3e by BellCodeEditor

auto save

parent e51af509
Showing with 14 additions and 5 deletions
......@@ -5,8 +5,18 @@ def new_input():
if u=="q":
break
else:
total.append(u)
try:
u=int(u)
except:
print("请重新输入一个数字")
else:
total.append(u)
return total
result=new_input()
print(result)
new_input()
\ No newline at end of file
def sum(money):
count=0
for i in money:
count=count+i
return count
price=new_input()
pay=sum(price)
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