Commit 59397cb7 by BellCodeEditor

save project

parent 9658841b
Showing with 5 additions and 18 deletions
...@@ -8,31 +8,17 @@ def func(): ...@@ -8,31 +8,17 @@ def func():
else: else:
total.append(int(unit)) total.append(int(unit))
except: except:
print("只能输入整数或q") print("只能输入整数或'q'")
return total return total
def sum(money): def sum(money):
count = 0 count = 0
for i in money: for i in money:
count + = i count += i
return count return count
list1 = func() list1 = func()
print(list1) result = sum(list1)
print(result)
\ 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