Sha256: 029f6e071decff33b8349036a3cd6843254886a669c0fc7630c5a051786e19e6

Contents?: true

Size: 482 Bytes

Versions: 396

Compression:

Stored size: 482 Bytes

Contents

def _is_pling(number):
    return number % 3 == 0


def _is_plang(number):
    return number % 5 == 0


def _is_plong(number):
    return number % 7 == 0


def _drops_for(number):
    drops = []
    if _is_pling(number):
        drops.append('Pling')

    if _is_plang(number):
        drops.append('Plang')

    if _is_plong(number):
        drops.append('Plong')

    return drops


def raindrops(number):
    drops = _drops_for(number)

    return ''.join(drops) or str(number)

Version data entries

396 entries across 396 versions & 1 rubygems

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