Commit 36388c5a by BellCodeEditor

save project

parent 49ae8edb
Showing with 14 additions and 5 deletions
...@@ -2,17 +2,26 @@ def new_input(): ...@@ -2,17 +2,26 @@ def new_input():
total = [] total = []
while True: while True:
unit=int(input("输入:")) unit=input("输入:")
if unit== 'q': if unit== 'q':
break break
else:
try: try:
unit=interesting(unit) unit=int(unit)
except: except:
print("输入数字") print("输入数字")
else: else:
total.append(unit) total.append(unit)
print("-"*30) print("-"*30)
return total return total
total=new_input() def sum(money):
print(total) count=0
\ No newline at end of file for i in money:
count=count+i
return count
price=new_input()
pay=sum(price)
print(pay)
\ 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