Commit 24c37ed1 by BellCodeEditor

save project

parent 8c7ba1d5
Showing with 15 additions and 8 deletions
...@@ -6,13 +6,20 @@ def new_input(): ...@@ -6,13 +6,20 @@ def new_input():
break break
else: else:
try: try:
unit=int(unit) unit=int(unit)
except: except:
print("12") print("12")
else: else:
total.append(unit) total.append(unit)
print("-"*30) finally:
print("-"*30)
print(total) return total
new_input() def sum(money):
\ No newline at end of file count = 0
for i in money:
count = count + i
return count
price = new_input()
pay = sum(price)
print("一共消费"+ str(pay) + "zhifu")
\ 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