Commit 28e7592c by BellCodeEditor

save project

parent 5d2e41ab
Showing with 9 additions and 3 deletions
def new_input(): def new_input():
total = ["饺子","乐事"] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
if unit== 'q': if unit== 'q':
...@@ -12,5 +12,11 @@ def new_input(): ...@@ -12,5 +12,11 @@ def new_input():
else: else:
total.append(unit) total.append(unit)
return total return total
def sum(money):
abd=0
for i in money:
abd=abd+i
return abd
abc=new_input() abc=new_input()
print(abc) pay=sum(abc)
\ No newline at end of file print(str(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