Guest User

Untitled

a guest
Dec 1st, 2019
124
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. math, physic, russian = 0, 0, 0 ; counter = 0 ; output = open('output.txt', 'w')
  2. with open('dataset_3363_4.txt') as text:
  3. for lines in text:
  4. middle = text.readline().strip().split(';')
  5. a, b, c = int(middle[1]), int(middle[2]), int(middle[3])
  6. print(( a + b + c)/3, middle, file = output)
  7. counter += 1
  8. math += a ; physic += b ; russian += c
  9. print((math/counter), (physic/counter), (russian/counter), file = output)
  10. output.close()
RAW Paste Data