2025-02-17 16:52:06 +01:00

34 lines
666 B
Python

students = {
'Alice': {
'Mathematiques': 90,
'Francais': 80,
'Histoire': 95
},
'Bob': {
'Mathematiques': 75,
'Francais': 85,
'Histoire': 70
},
'Charlie': {
'Mathematiques': 88,
'Francais': 92,
'Histoire': 78
}
}
name = input("Entrez le nom de l'étudiant : ")
if name in students:
total = 0
print(f"Notes de {name}:")
for i in students[name]:
note = students[name][i]
total += note
print(i, ":", note)
print(f"Moyenne de {name} : {total/len(students[name])}")
else:
print("L'étudiant", name, "n'existe pas.")