FAMILY.PY | OOPython Simple code where family and person instances can be created. There is a method where any instance of Person can be added to any instance of Family.

class Family:
    def __init__(self):
        self.names, self.birthplaces, self.dobs, self.deaths = [], [], [], []


class Person:
    def __init__(self, name, birthplace, dob, death=None):
        self.name, self.birthplace, self.dob, self.death = name, birthplace, dob, death

    def add_member_to(self, family_tree):
        family_tree.names.append(self.name)
        family_tree.birthplaces.append(self.birthplace)
        family_tree.dobs.append(self.dob)

        if self.death is None:
            family_tree.deaths.append('N/A')
        else:
            family_tree.deaths.append(self.death)


family = Family()
mike = Person('Michael', 'Nigeria', '06-07-2004')
esther = Person('Esther', 'KC', '03-25-2009')
mike.add_member_to(family)
esther.add_member_to(family)
print(family.dobs)
print(family.names)
print(family.birthplaces)
print(family.deaths)
My one improvement would be this line of code

if self.death is None:
    family_tree.deaths.append('N/A')
else:
    family_tree.deaths.append(self.death)


can be reduced to one line:

family_tree.deaths.append('N/A' if self.death is None else self.death)


Also, I would recommend keeping all code not in these classes in a main guard, so you can import these classes without also running the code in the module.