It's a design issue. Here is my son's school report
FRANCAIS Mrs xxx 17,0 , 13,0 , 16,0 , 19,0 , 10,5 , 18,0
LATIN Mrs xxx 5,0
ANGLAIS LV1 Miss xxx 12,5 , 18,0
ESPAGNOL LV1 Mrs xxx 12,5 , 8,0 , 12,0
HIST/GEO/ED.CIV Miss xxx 15,0 , 13,5
MATHEMATIQUES Mrs xxx 16,0 , 17,5 , 20,0 , 17,5
PHYSIQUE Miss xxx 10,0 , 13,5
SC VIE ET TERRE Mrs xxx 18,5 , 15,0 As you can see there is a list of subjects and for each subject, a list of marks. These lists of marks belong to both my son and the subject. So I suggest the following class design:
class Student:
# members
name
report
class Subject:
# members
name
teacher_name "report" can be a list of pairs (subject, list of marks), or a dictionary subject --> list of marks.
Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691