Hello
I am creating three classes and I try to use aggregation/association between them for inheritance.
The first class has the info of the student (Student class), the second one has the subject info (Cousre class) and the grades of a students - Grdes class (used association between student and course class).
Now I try to use aggregation between the grades class and the course class.
The methods of the Course class are: subject, name and grade
Thus I want to creata a dictionary in the Grades class, which stores the name as key and the grades as values of the students.
How can I do this with aggregation. I though of creating a library in a class but not in any method and use this "Grades.dictionary" to call it.
It seems though, when I try to use the name of a student (using a Course-object) in the dictionary created I get this:
<bound method Course.get_student_name of <__main__.Course object at 0x00000279478578E0>>
So it returns this instead of the student's name thus I cannot use the dictionary.
Thank you in advance!
I am creating three classes and I try to use aggregation/association between them for inheritance.
The first class has the info of the student (Student class), the second one has the subject info (Cousre class) and the grades of a students - Grdes class (used association between student and course class).
Now I try to use aggregation between the grades class and the course class.
The methods of the Course class are: subject, name and grade
Thus I want to creata a dictionary in the Grades class, which stores the name as key and the grades as values of the students.
How can I do this with aggregation. I though of creating a library in a class but not in any method and use this "Grades.dictionary" to call it.
It seems though, when I try to use the name of a student (using a Course-object) in the dictionary created I get this:
<bound method Course.get_student_name of <__main__.Course object at 0x00000279478578E0>>
So it returns this instead of the student's name thus I cannot use the dictionary.
Thank you in advance!