Commit 1b7196ea by BellCodeEditor

save project

parent 34a1c4ca
Showing with 6 additions and 4 deletions
...@@ -12,8 +12,8 @@ def new_input(): ...@@ -12,8 +12,8 @@ def new_input():
else: else:
total.append(unit) total.append(unit)
return(total) return(total)
# 求列表之和
def sum(a): def sum(a):
count=0 count=0
for i in a: for i in a:
count=count+i count=count+i
...@@ -23,4 +23,6 @@ def sum(a): ...@@ -23,4 +23,6 @@ def sum(a):
# print(a) # print(a)
d=new_input() d=new_input()
print(d) print(d)
\ No newline at end of file a=sum(d)
print(a)
\ 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