Commit 2f86e1af by BellCodeEditor

save project

parent c9c18320
Showing with 5 additions and 4 deletions
...@@ -6,20 +6,21 @@ def new_input(): ...@@ -6,20 +6,21 @@ def new_input():
break break
else: else:
try: try:
money = int(money ) unit=int(unit)
except: except:
print("请输入一个数字") print("请输入一个数字")
else: else:
total.append(money) total.append(unit)
print("-"*30) print("-"*30)
return total return total
def sum(money) : def sum(money) :
count = 0 count = 0
for i in money : for i in money :
count = count + 1 count = count + 1
return count return count1
price = new_input() price = new_input()
pay = sum(price) 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