forked from exercism/python
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proverb: Update exercise to canonical-data 1.0.0 (exercism#1114)
- Loading branch information
Nathan Parsons
authored
Nov 21, 2017
1 parent
620afe0
commit 0965483
Showing
4 changed files
with
53 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
def proverb(itens, qualifier=''): | ||
def proverb(rhyme_items): | ||
if not rhyme_items: | ||
return "" | ||
phrases = ['For want of a {0} the {1} was lost.'.format(el1, el2) | ||
for el1, el2 in zip(itens, itens[1:])] | ||
qualifier += ' ' if qualifier else '' | ||
phrases.append('And all for the want of a {0}{1}.'.format(qualifier, | ||
itens[0])) | ||
for el1, el2 in zip(rhyme_items, rhyme_items[1:])] | ||
phrases.append('And all for the want of a {0}.'.format(rhyme_items[0])) | ||
return '\n'.join(phrases) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
def proverb(rhyme_text): | ||
def proverb(rhyme_items): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters