Commit 925b0f7f by BellCodeEditor

save project

parent b776391d
Showing with 14 additions and 6 deletions
......@@ -6,14 +6,23 @@ def new_input():
break
else:
try:
unit=int(money)
unit=int(unit)
except:
print('重新输入')
else:
total.append(money)
print("_"*30)
total.append(unit)
finally:
print("=====================")
return total
r=new_input()
print(r)
\ No newline at end of file
def sum(money):
count=0
for i in money:
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