Sha256: 88a3613841a519ed84434ecce4e64aa4bba15a4997a29a8f8d60ed94a960b5a2

Contents?: true

Size: 712 Bytes

Versions: 396

Compression:

Stored size: 712 Bytes

Contents

class Garden(object):

    __plant_names = {"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.plant_rows = diagram.split()
        self.students = sorted(students)

    def plants(self, student):
        slot_start = self.students.index(student) * 2
        slot = slice(slot_start, slot_start + 2)
        return [self.__plant_names[abbrev]
                for abbrev in (self.plant_rows[0][slot] +
                               self.plant_rows[1][slot])]

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.179 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.178 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.177 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.176 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.175 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.174 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.173 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.172 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.171 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.170 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.169 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.167 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.166 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.165 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.164 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.163 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.162 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.161 tracks/python/exercises/kindergarten-garden/example.py
trackler-2.2.1.160 tracks/python/exercises/kindergarten-garden/example.py