The example solution init() method missed self.ward_id = ward_id. The code should be:
class Ward:
def __init__(self, ward_id):
self.ward_id = ward_id # this is missing
self.patients = []
def add_patient(self, patient):
self.patients.append(patient)
@property
def n_patients(self):
'''
Number of the patients...
'''
return len(self.patients)
Exercise 2:
The example solution init() method missed self.ward_id = ward_id. The code should be: