class Participant:
    def __init__(self, participant_id, condition, age):
        self.participant_id = participant_id
        self.condition = condition
        self.age = age
        self.responses = []

    def add_response(self, item, value):
        self.responses.append({"item": item, "value": value})

    def mean_response(self):
        values = [r["value"] for r in self.responses]
        return sum(values) / len(values) if values else float("nan")
>>> p1 = Participant("P001", "treatment", 34)
>>> p1.add_response("item1", 4)
>>> p1.add_response("item2", 5)
>>> p1.mean_response()
4.5
