This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Garden(object): | |
| PLANTS = {'C': 'Clover', 'G': 'Grass', 'R': 'Radishes', 'V': 'Violets'} | |
| def __init__(self, diagram, | |
| students='Alice Bob Charlie David Eve Fred Ginny Harriet Ileana Joseph Kincaid Larry'.split()): | |
| self.plants_list = self.plants_per_student(diagram, sorted(students)) | |
| def plants(self, name): | |
| return list(map(lambda plant: self.PLANTS[plant], self.plants_list[name])) |