Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson13-4

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • lesson13-4
  • diy.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · 9c75f9ca
    BellCodeEditor committed a year ago
    9c75f9ca
diy.py 297 Bytes
Edit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
with open(r'c:\Users\lenovo\Documents\lesson13_2\sales_list.txt','r',encoding='utf-8') as file:

    b=file.readlines()

for i in b:
    d=i.split()
    #  print(d[1:])
    #  print(d[0])
    sum=0
    for e in d[1:]:
      sum=sum+int(e)
    g=d[0]+str(sum)
    print(g)