Commit 36388c5a by BellCodeEditor

save project

parent 49ae8edb
Showing with 19 additions and 10 deletions
......@@ -2,17 +2,26 @@ def new_input():
total = []
while True:
unit=int(input("输入:"))
unit=input("输入:")
if unit== 'q':
break
try:
unit=interesting(unit)
except:
print("输入数字")
else:
total.append(unit)
print("-"*30)
try:
unit=int(unit)
except:
print("输入数字")
else:
total.append(unit)
print("-"*30)
return total
total=new_input()
print(total)
\ 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(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