Commit 2e575e2f by BellCodeEditor

save project

parent c29cb048
import func
b=a()
print(sum(b))
\ No newline at end of file
file=open(r'C:\Users\admin\Desktop\book.txt',"w",encoding="utf-8")
file.write('小兰:12本\n小丽:11本\n李文:9本\n张伟:16本\n')
file.close
\ No newline at end of file
...@@ -11,10 +11,9 @@ def a(): ...@@ -11,10 +11,9 @@ def a():
else: else:
total.append(unit) total.append(unit)
return total return total
b=a() def sum(b):
def sum():
c=0 c=0
for i in b: for i in b:
c+=i c+=i
return c return c
print(sum()) # print(sum())
\ No newline at end of file \ 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