Commit 340bf53c by BellCodeEditor

save project

parent dd9c2fd6
Showing with 11 additions and 2 deletions
...@@ -8,5 +8,14 @@ def new_input(): ...@@ -8,5 +8,14 @@ def new_input():
try: try:
unit=int(unit) unit=int(unit)
except: except:
print(shuru) print(输入整数)
print(total) else:
total.append(unit)
return total
price=new_input()
def sum(amount):
amount_sum=0
for i in amount:
amount_sum+=i
return amount_sum
print("总金额是",sum(price))
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