Sha256: 37c37ae05284904a8df0d11dc6834557fd5fc4ae311b28f1df8245cb57df497c

Contents?: true

Size: 922 Bytes

Versions: 52

Compression:

Stored size: 922 Bytes

Contents

parts = [('lay in', 'the house that Jack built.'),
         ('ate', 'the malt'),
         ('killed', 'the rat'),
         ('worried', 'the cat'),
         ('tossed', 'the dog'),
         ('milked', 'the cow with the crumpled horn'),
         ('kissed', 'the maiden all forlorn'),
         ('married', 'the man all tattered and torn'),
         ('woke', 'the priest all shaven and shorn'),
         ('kept', 'the rooster that crowed in the morn'),
         ('belonged to', 'the farmer sowing his corn'),
         ('', 'the horse and the hound and the horn')]


def verse(verse_num):
    v = ['This is {}'.format(parts[verse_num][1])]
    v.extend(['that {0} {1}'.format(*parts[i])
              for i in range(verse_num - 1, -1, -1)])
    return ''.join(v)


def recite(start_verse, end_verse):
    result = []
    for verse_num in range(start_verse-1, end_verse):
        result.append(verse(verse_num))
    return result

Version data entries

52 entries across 52 versions & 1 rubygems

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