class Human:
def __init__(self,name,surname,second_name):
self.name = name
self.surname = surname
self.second_name = second_name
def __str__(self):
return "Ім'я = {}, Прізвище = {}, По батькові = {}".format(self.name,self.surname,self.second_name)
human_one = Human("Петро","Порошенко","Олексі́йович")
print(human_one)
class Student(Human):
def __init__(self,name,surname,second_name, course, age):
super().__init__(name,surname,second_name)
self.course = course
self.age = age
def __str__(self):
return("Student: [Ім'я = "+str(self.name)+ ", Прізвище = "+str(self.surname)+", По батькові = "+str(self.second_name)+", Курс = "+str(self.course)+", Роки життя = "+str(self.age),"]")
class Group:
def __init__(self):
self.list = []
def add_messega(self,messega):
return self.list.append(messega)
def __str__(self):
return str(self.list)
group_one = Group()
human_one = Student("Петро","Порошенко","Олексі́йович","4", "23")
human_two = Student("Алексій","Стерненко","Сергійович","2", "19")
group_one.add_messega(human_one)
group_one.add_messega(human_two)
print(group_one)
When I try to display the list of students, I get the following error