```from random import choice, randint
Beat poetry
adjectives = "古池や 蛙飛び込む 水の音 春の海 ひねもすのたり のたりかな痩蛙 負けるな一茶 是にあり".split() verbs = "菜の花や 月は東に 日は西に閑けさや 岩にしみいる 蝉の声柿くへば 鐘が鳴るなり 法隆寺".split() nouns = "目には青葉 山ほとゝぎす はつ松魚目には青葉 山ほとゝぎす はつ松魚目には青葉 山ほとゝぎす はつ松魚".split()
def beat_poem(): print "\n" + "="*16+" a poem " + "="*16 for x in range(randint(5,11)): words1 = " ".join([choice(adjectives) + ", ", choice(adjectives)]) words2 = " ".join([choice(nouns), choice(verbs)]) words3 = " ".join([choice(nouns), choice(nouns), choice(adjectives), choice(nouns)])
for i in range(randint(2,5)):
words = choice([words1, words2, words3])
line = " "*randint(0, 40 - len(words)) + words
print line
if x % 3 ==0:
print
print " "*5 + choice(nouns)
print " "*5 + choice(nouns)
print " "*5 + "the " + choice(nouns) +"!"
print
if x % 7 ==0:
words4 = " ".join(["the " + choice(adjectives), choice(nouns), choice(verbs)])
print
print " ".join(words4)
print
beat_poem()```
Built With
- poem
- randit
Log in or sign up for Devpost to join the conversation.