
# student.py

import datetime

class Person():

    def __init__(self, name):
        self.name = name
        self.birthday = None

    def __str__(self):
        return self.name + ": " + str(self.birthday)

    def getName(self):
        return self.name

    def setBirthday(self, day, month, year):
        self.birthday = datetime.date(year, month, day)

    def getAge(self):
        # returns self's current age in days
        if self.birthday == None:
            print("No birthday information")
            return 0
        else:
            return (datetime.date.today() - self.birthday).days


# --------------------------------------------------------------------


class Student(Person):

    def __init__(self, name, id):
        super().__init__(name) # initialize Person data
        self.id = id

    def __str__(self):
        return super().__str__() + " (" + str(self.id )+ ")"  # return all data

    def setId(self, id):
        self.id = id



# test code
s1 = Student('Alice', 10023)
s1.setBirthday(5, 6, 2001)

s2 = Student('John', 10015)
s2.setBirthday(3, 2, 2002)

s3 = Student('Bill', 10029)
s3.setBirthday(2, 2, 2002)

print(s1)
print("Student 2:", s2.name, ",", s2.id)

print()
students = [s1,s2,s3]
for s in students:
    print(" ", s, "; today:", s.getAge())
