Ad

nice kumite

I think the test case for caterpillar3 was broken

Code
Diff
  • def caterpillar(segments, legpairs):
        head = [
            '\_/',
            '(")',
            '   '
        ]
    
        segment = [
            '_' * legpairs + ' ',
            'o' * legpairs + ')',
            '^' * legpairs + ' '
        ]
    
        return '\n'.join(
            (head_row + segment_row * segments).rstrip()
            for head_row, segment_row in zip(head, segment)
        )
    
    • def caterpillar(segments, legpairs):
    • pass
    • head = [
    • '\_/',
    • '(")',
    • ' '
    • ]
    • segment = [
    • '_' * legpairs + ' ',
    • 'o' * legpairs + ')',
    • '^' * legpairs + ' '
    • ]
    • return '\n'.join(
    • (head_row + segment_row * segments).rstrip()
    • for head_row, segment_row in zip(head, segment)
    • )