Commit 2f9935ff by BellCodeEditor

save project

parent 0404a370
Showing with 21 additions and 3 deletions
...@@ -10,8 +10,15 @@ def new_input(): ...@@ -10,8 +10,15 @@ def new_input():
except: except:
print("请重新输入一个数字") print("请重新输入一个数字")
else: else:
total.append(int(unit)) total.append(unit)
finally:
print("-"*30) print("-"*30)
return total return total
result = new_input() def sum(a):
print(total) b = 0
for i in a:
b=b+i
return b
c = new_input()
dd= sum(c)
print("您一共消费了"+str(dd)+"元")
def sum(a):
b = 0
for i in a:
b=b+1
return b
c = new_input()
pay = sum(print)
\ 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