class Course:
def __init__(self, id, title, credit):
self.__c_id = id #원래 가지고 있던 attribute
self.__c_title = title #원래 가지고 있던 attribute
self.__credit= credit #원래 가지고 있던 attribute
self.__inrolled_students = [] #aggregation 형태
self.__instructor = None #aggregation 형태
...
def take_course(self, student):
self.__enrolled_students.append(student) #위에 있는 빈 리스트에다 append를 한다.
def register_instructor(self, instructor):
self.__instructor = instructor # instructor 객체가 전달