Sha256: 28473c6f08666cd6a9b1f8405d02ef244601c91f682f81d551d83797ad0d81d5

Contents?: true

Size: 498 Bytes

Versions: 119

Compression:

Stored size: 498 Bytes

Contents

class Allergies:

    _allergies = [
        "eggs",
        "peanuts",
        "shellfish",
        "strawberries",
        "tomatoes",
        "chocolate",
        "pollen",
        "cats"
    ]

    def __init__(self, score):
        self.score = score

    def is_allergic_to(self, allergy):
        return self.score & 1 << self._allergies.index(allergy)

    @property
    def lst(self):
        return [allergy for allergy in self._allergies
                if self.is_allergic_to(allergy)]

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
trackler-2.0.6.43 tracks/python/exercises/allergies/example.py
trackler-2.0.6.42 tracks/python/exercises/allergies/example.py
trackler-2.0.6.41 tracks/python/exercises/allergies/example.py
trackler-2.0.6.40 tracks/python/exercises/allergies/example.py
trackler-2.0.6.39 tracks/python/exercises/allergies/example.py
trackler-2.0.6.38 tracks/python/exercises/allergies/example.py
trackler-2.0.6.37 tracks/python/exercises/allergies/example.py
trackler-2.0.6.36 tracks/python/exercises/allergies/example.py
trackler-2.0.6.35 tracks/python/exercises/allergies/example.py
trackler-2.0.6.34 tracks/python/exercises/allergies/example.py
trackler-2.0.6.33 tracks/python/exercises/allergies/example.py
trackler-2.0.6.32 tracks/python/exercises/allergies/example.py
trackler-2.0.6.31 tracks/python/exercises/allergies/example.py
trackler-2.0.6.30 tracks/python/exercises/allergies/example.py
trackler-2.0.6.29 tracks/python/exercises/allergies/example.py
trackler-2.0.6.28 tracks/python/exercises/allergies/example.py
trackler-2.0.6.27 tracks/python/exercises/allergies/example.py
trackler-2.0.6.26 tracks/python/exercises/allergies/example.py
trackler-2.0.6.25 tracks/python/exercises/allergies/example.py
trackler-2.0.6.24 tracks/python/exercises/allergies/example.py