【发布时间】:2018-11-13 16:13:55
【问题描述】:
这是我的文本文件:
#EMP_NO, EMP_NAME, AGE, POSITION, SALARY, YRS_EMP
001, Peter Smyth, 26, Developer, 29000, 4
002, Samuel Jones, 23, Developer, 24000, 1
003, Laura Stewart, 41, DevOps, 42000, 15
004, Paul Jones, 24, Analyst, 21000, 2
005, Simon Brown, 52, Developer, 53000, 18
006, George Staples, 42, Tester, 42000, 12
007, Greg Throne, 57, DevOps, 50000, 23
008, Aston Bently, 27, Tester, 33000, 5
009, Ben Evans, 32, DevOps, 38000, 2
010, Emma Samson, 23, DevOps, 22000, 1
011, Stephanie Beggs, 43, Tester, 19000, 9
012, Sarah McQuillin, 47, DevOps, 23000, 5
013, Grace Corrigan, 48, Analyst, 44000, 16
014, Simone Mills, 32, DevOps, 32000, 11
015, Martin Montgomery, 28, Analyst, 28000, 3
我需要得到所有的薪水并将它们加在一起,但我只能返回整行,有什么想法如何在 python 3 中做到这一点?
我试图从以下问题中得到答案,但这无法对我的代码产生影响:Tried Question
【问题讨论】:
-
到目前为止你有什么尝试?
标签: python python-3.x file csv