fork download
  1. student=[]
  2. n=int(input(f"Nhap so luong hoc sinh: "))
  3. for i in range(n):
  4. name=input(f"Nhap ten hoc sinh{i+1}: ")
  5. score1=float(input(f"Nhap diem thu 1 cua {name}: "))
  6. score2=float(input(f"Nhap diem thu 2 cua {name}: "))
  7. score3=float(input(f"Nhap diem thu 3 cua {name}: "))
  8. student.append([name,score1,score1,score3])
  9. for hs in student:
  10. name=hs[0]
  11. score1=hs[1]
  12. score2=hs[2]
  13. score3=hs[3]
  14. avg_score=(score1+score2+score3)/3
  15. print("Diem trung binh cua hoc sinh {name}: {avg_score}")
Success #stdin #stdout 0.12s 14068KB
stdin
2
thanh dat
10 
10
10
khai 
1
1
1
stdout
Nhap so luong hoc sinh: Nhap ten hoc sinh1: Nhap diem thu 1 cua thanh dat: Nhap diem thu 2 cua thanh dat: Nhap diem thu 3 cua thanh dat: Nhap ten hoc sinh2: Nhap diem thu 1 cua khai : Nhap diem thu 2 cua khai : Nhap diem thu 3 cua khai : Diem trung binh cua hoc sinh {name}: {avg_score}
Diem trung binh cua hoc sinh {name}: {avg_score}