File size: 1,148 Bytes
aadd23b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Student:
    def __init__(self, educmaster, prenom, nom, serie, resultats):
        self.educmaster = educmaster
        self.prenom = prenom
        self.nom = nom
        self.serie = serie
        self.resultats = resultats

    def afficher_moyennes_par_annee(self, coefficients):
        resultats_str = f"Résultats pour {self.prenom} {self.nom} (ID: {self.educmaster}) en Série {self.serie} :\n"
        for annee, matieres in self.resultats.items():
            resultats_str += f"\nAnnée: {annee}\n"
            if annee == "Baccalauréat":
                for matiere, note in matieres.items():
                    coef = coefficients.get_coefficient(matiere)
                    resultats_str += f"- {matiere} (Coef {coef}): {note}\n"
            else:
                for matiere, moyennes in matieres.items():
                    moy_sem1 = moyennes["Semestre 1"]
                    moy_sem2 = moyennes["Semestre 2"]
                    coef = coefficients.get_coefficient(matiere)
                    resultats_str += f"- {matiere} (Coef {coef}): Semestre 1: {moy_sem1}, Semestre 2: {moy_sem2}\n"
        return resultats_str