class Car:
    def __init__(self, name, capacity):
        self.name = name
        self.capacity = capacity
        # Array
        self.seats = []
        i = 0
        while i < self.capacity:
            self.seats.append(None)
            i += 1

    def count(self):
        num = 0
        i = 0
        while i < self.capacity:
            if self.seats[i] is not None:
                num += 1
            i += 1
        return num

    def pickup(self, person):
        if self.count() < self.capacity:
            i = 0
            while i < self.capacity:
                if self.seats[i] is None:
                    self.seats[i] = person
                    return True
                i += 1
        else:
            return False

    def kickout(self, person):
        i = 0
        while i < self.capacity:
            temp = self.seats[i]

            if person == temp:
                self.seats[i] = None
                return
            i += 1

class Person:
    def __init__(self, name, is_happy, age):
        self.name = name
        self.is_happy = is_happy
        self.age = age

    def __repr__(self):
        return self.name

car = Car("五菱宏光", 3)
p1 = Person("Ada", True, 12)
p2 = Person("Bill", True, 25)
p3 = Person("Cherry", False, 12)
p4 = Person("David", False, 12)
print("Start with an empty car", car.count())
print("Add Ada", car.pickup(p1))
print("Count", car.count())
print("Add Bill", car.pickup(p2))
print("Count", car.count())
print("Add Cherry", car.pickup(p3))
print("Count", car.count())
print("Add David", car.pickup(p4))
print("Count", car.count())
print("Car seats:", car.seats)
