class LibraryCodes(object): construction_code = { 'Wall': '1', 'Ground': '2', 'Roof': '3', 'interior wall': '5', 'ground wall': '6', 'attic floor': '7', 'interior slab': '8' } def construction_types_to_code(self, construction_type): return self.construction_code[construction_type]