Commit 4e635cb8 by BellCodeEditor

save project

parent 0cc37ad4
Showing with 28 additions and 0 deletions
with open(r"c:\Users\Administrator\Documents\lesson13-4\sales_list.txt",'r',encoding="utf-8") as file1:
text = file1.readlines()
#print(text)
for txt in text:
data = txt.split()
#print(data[0])
#print(data[1:])
total = data[1:]
a = 0
for num in total:
a +=int(num)
print(data[0]+str(a))
\ No newline at end of file
悟空 348
诺依 380
小贝 182
李丽 201
宋扬 107
王明 245
李强 164
孙小白 222
苏琪 137
刘若若 147
刘阳 226
王胜男 123
王娇 131
坤坤 123456
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