s452097-mlworkshops/werAvCounter.py

17 lines
357 B
Python
Raw Normal View History

2020-04-03 17:09:39 +02:00
import sys
if __name__ == '__main__':
2020-04-03 17:20:24 +02:00
werAv = 0
2020-04-03 17:09:39 +02:00
sum = 0
lineCount = 0
2020-04-03 17:16:33 +02:00
with open('wer.txt','r+') as werOut, \
open('werFinish.txt','w+') as werF:
2020-04-03 17:20:24 +02:00
for line in werOut:
num = float(line)
sum += num
lineCount += 1
2020-04-03 17:09:39 +02:00
2020-04-03 17:26:16 +02:00
werAv = (sum / lineCount) * 100
2020-04-03 17:20:24 +02:00
werF.write(f'{werAv:.5f}\n')