Commit 9641b07f by BellCodeEditor

save project

parent db1e4e09
Showing with 7 additions and 7 deletions
def new_input():
total = []
while True:
money= input("请输入:")
if money== 'q':
unit= input("请输入:")
if unit== 'q':
break
else:
try:
money = int(money)
unit = int(unit)
except:
print("请输字")
else:
total.append(money)
total.append(unit)
finally:
print("-"*100)
print("====================")
return total
def sum(money):
......@@ -21,6 +21,6 @@ def sum(money):
count = count + i
return count
result = new_input()
price = new_input()
pay = sum(price)
print("你消费了" + str(pay) + "")
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