#!/usr/bin/env python3
import random
articles = ['The','a']
subjects = ['man','cat','dog','bastard','python']
verbs = ['kiss','grab','choke']
adverbs = ['furiously','firmly','gently']
try:
numLines = input('How many lines of poetry you want? (<Enter> for default)\n')
numLines = int(numLines)
except ValueError:
print('Not a valid number, using default value\n')
numLines = 5
i = 0
while i < numLines:
if random.randint(0,1) > 0:
poetryLine = [random.choice(articles),random.choice(subjects),random.choice(verbs),random.choice(adverbs)]
else:
poetryLine = [random.choice(articles),random.choice(subjects),random.choice(verbs)]
spacedPoetryLine = ''
for line in poetryLine:
spacedPoetryLine += line + " "
print(spacedPoetryLine)
i += 1