-
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.
- Loading branch information
Showing
4 changed files
with
51 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import string | ||
from .words import get_one_word_dict | ||
from .words import Words | ||
|
||
|
||
def praise(template="You are ${adjective}!"): | ||
if template == None: | ||
template = "None" | ||
template = string.Template(template) | ||
words = get_one_word_dict() | ||
result = template.substitute(words) | ||
result = template.substitute(Words()) | ||
return result |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
def caption_check(word, word_list): | ||
if not word.isalpha(): | ||
return True | ||
return word.isupper() and word.lower() in word_list | ||
|
||
|
||
def first_letter_caption_check(word, word_list): | ||
if not word.isalpha(): | ||
return True | ||
return word[0].isupper and word[1:].islower() and word.lower() in word_list |
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