Last active
June 4, 2018 15:48
-
-
Save 20esaua/2d490553eb8068c31b7bfb3317141fec to your computer and use it in GitHub Desktop.
Refactored version
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
text = 'Once upon a time in the land of Tigernet there lived a wise, but $adjective wizard named James. In his dominion was all kinds of electronic $nouns and $nouns. One day, the wizard Fulton declared, \'Let us make a giant balloon and adorn it with such devices as $nouns, $adjective $nouns, and $adjective $nouns. With these devices we will measure the curvature of the $noun - a $adjective but important scientific inquiry.\' So the many citizens of Tigernet embraced the $adjective mission of their leader and began the $adjective and $adjective task of building the $nouns. They used $adjective tools to make $quantity $adjective $nouns - some were $adjective while others were $adjective. They worked $adverb for $quantity days and nights. Finally, the day came to launch. They filled the $adjective balloon and watched it $adverb rise into the $adjective $adjective sky. It was a beautiful sight.' | |
for wordtype in {'noun', 'verb', 'adjective', 'adverb', 'quantity'}: | |
for _ in range(text.count('$%s' % wordtype)): | |
text = text.replace('$%s' % wordtype, input('Enter a %s: ' % wordtype), 1) | |
print('='*80 + '\n%s' % text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment