Commit 82010c69 by BellCodeEditor

save project

parent 5e6640c2
Showing with 16 additions and 7 deletions
def new_input():
total = []
total=[]
while True:
unit= input("请输入:")
if unit== 'q':
unit=input("请输入:")
if unit=='q':
break
else:
try:
......@@ -11,6 +11,15 @@ def new_input():
print("请输入一个数字")
else:
total.append(unit)
print("-"*30)
print(total)
new_input()
\ No newline at end of file
finally:
print('******************************************************')
return total
def sum(price):
count = 0
for i in price:
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