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.8.18 tracks/python/exercises/allergies/example.py
trackler-2.0.8.17 tracks/python/exercises/allergies/example.py
trackler-2.0.8.16 tracks/python/exercises/allergies/example.py
trackler-2.0.8.15 tracks/python/exercises/allergies/example.py
trackler-2.0.8.14 tracks/python/exercises/allergies/example.py
trackler-2.0.8.13 tracks/python/exercises/allergies/example.py
trackler-2.0.8.12 tracks/python/exercises/allergies/example.py
trackler-2.0.8.11 tracks/python/exercises/allergies/example.py
trackler-2.0.8.10 tracks/python/exercises/allergies/example.py
trackler-2.0.8.9 tracks/python/exercises/allergies/example.py
trackler-2.0.8.8 tracks/python/exercises/allergies/example.py
trackler-2.0.8.7 tracks/python/exercises/allergies/example.py
trackler-2.0.8.6 tracks/python/exercises/allergies/example.py
trackler-2.0.8.5 tracks/python/exercises/allergies/example.py
trackler-2.0.8.4 tracks/python/exercises/allergies/example.py
trackler-2.0.8.3 tracks/python/exercises/allergies/example.py
trackler-2.0.8.2 tracks/python/exercises/allergies/example.py
trackler-2.0.8.1 tracks/python/exercises/allergies/example.py
trackler-2.0.7.0 tracks/python/exercises/allergies/example.py
trackler-2.0.6.44 tracks/python/exercises/allergies/example.py