# person.py
#
# ICS 33 Spring 2026
# Code Example
#
# A short Person class that demonstrates the distinction between attributes of
# classes and attributes of their objects.


class Person:

    # This is a class attribute, which is to say that there's one value
    # named MAX_NAME_LENGTH, which is associated with the Person class as
    # a whole (i.e., it's stored in the dictionary belonging to the class).
    MAX_NAME_LENGTH = 30


    def __init__(self, name, age):
        # Ensure that names will never be longer than the maximum, and that
        # ages will never be negative.
        self.name = name[:self.MAX_NAME_LENGTH]
        self.age = max(0, age)


    def describe(self):
        return f'{self.name}, age {self.age}'
