Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open(r'C:\Pyton\dataset_3363_2.txt') as inf:
- ishod=[]
- for line in inf:
- line=line.strip().split(';')
- ishod=ishod+line
- summa1=[] #собираю оценки по каждому из предметов в свой список чтоб потом суммировать
- summa2=[]
- summa3=[]
- s1, s2, s3= 1, 2, 3
- for x in range(len(ishod)):
- if s1>(len(ishod)):break
- summa1.append(int(ishod[s1]))
- summa2.append(int(ishod[s2]))
- summa3.append(int(ishod[s3]))
- print((int(ishod[s1])+int(ishod[s2])+int(ishod[s3]))/3)
- s1+=4
- s2+=4
- s3+=4
- print(sum(summa1)/len(summa1), sum(summa2)/len(summa2), sum(summa3)/len(summa3))
Advertisement
Add Comment
Please, Sign In to add comment