i print my student info i get that but i get a none after that i dont understand why? and i tried return but it only does it for the first value in "def get_info". Output: 10 saif 14 5 None ahmed 48 20 None
class Student:
def __init__(self, name, age, yearsplay):
self.name = name
self.age = age
self.yearsplay = yearsplay
def get_info(self):
print(self.name)
print( self.age)
print(self.yearsplay)
class Course:
def __init__(self, Maxstudents):
self.Maxstudents = Maxstudents
self.Students = []
print(Maxstudents)
def add_students(self, Student):
if len(self.Students) < self.Maxstudents:
self.Students.append(Student)
print(Student.get_info())
s1 = Student("saif", 14, 5)
s2 = Student("ahmed", 48, 20)
c = Course(10)
c.add_students(s1)
c.add_students(s2)