22 NSI 40
In [ ]:
Copied!
resultats = {'Dupont':{'DS1' : [15.5, 4],
'DM1' : [14.5, 1],
'DS2' : [13, 4],
'PROJET1' : [16, 3],
'DS3' : [14, 4]},
'Durand':{'DS1' : [6 , 4],
'DM1' : [14.5, 1],
'DS2' : [8, 4],
'PROJET1' : [9, 3],
'IE1' : [7, 2],
'DS3' : [8, 4],
'DS4' :[15, 4]}}
resultats = {'Dupont':{'DS1' : [15.5, 4],
'DM1' : [14.5, 1],
'DS2' : [13, 4],
'PROJET1' : [16, 3],
'DS3' : [14, 4]},
'Durand':{'DS1' : [6 , 4],
'DM1' : [14.5, 1],
'DS2' : [8, 4],
'PROJET1' : [9, 3],
'IE1' : [7, 2],
'DS3' : [8, 4],
'DS4' :[15, 4]}}
In [ ]:
Copied!
def moyenne(nom):
if nom in ...:
notes = resultats[nom]
total_points = ...
total_coefficients = ...
for ... in notes.values():
note , coefficient = valeurs
total_points = total_points + ... * coefficient
total_coefficients = ... + coefficient
return round( ... / total_coefficients , 1 )
else:
return -1
def moyenne(nom):
if nom in ...:
notes = resultats[nom]
total_points = ...
total_coefficients = ...
for ... in notes.values():
note , coefficient = valeurs
total_points = total_points + ... * coefficient
total_coefficients = ... + coefficient
return round( ... / total_coefficients , 1 )
else:
return -1