Sha256: 9525e04bb18cf81217bb69d71237811cfcfcbd4b9d1ad01c510b07443b4b176a

Contents?: true

Size: 864 Bytes

Versions: 11

Compression:

Stored size: 864 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][0], parts[i][1])
              for i in range(verse_num - 1, -1, -1)])
    v[-1] += '.'
    return '\n'.join(v)


def rhyme():
    return "\n\n".join(verse(n) for n in range(len(parts)))

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
trackler-2.2.1.107 tracks/python/exercises/house/example.py
trackler-2.2.1.106 tracks/python/exercises/house/example.py
trackler-2.2.1.105 tracks/python/exercises/house/example.py
trackler-2.2.1.104 tracks/python/exercises/house/example.py
trackler-2.2.1.103 tracks/python/exercises/house/example.py
trackler-2.2.1.102 tracks/python/exercises/house/example.py
trackler-2.2.1.101 tracks/python/exercises/house/example.py
trackler-2.2.1.100 tracks/python/exercises/house/example.py
trackler-2.2.1.99 tracks/python/exercises/house/example.py
trackler-2.2.1.98 tracks/python/exercises/house/example.py
trackler-2.2.1.97 tracks/python/exercises/house/example.py