The task is really unsuccessful, as in my opinion. And its submission only confuses. "do 5 cycles" - why 5 ??? unclear. For quatrain, 4 is required. In general, 1 cycle and 4 iterations. In general, they want something like this from you.
import random articles = ['the', 'a'] nouns = ['cat', 'dog', 'man', 'woman'] verbs = ['sang', 'ran', 'jumped'] adverbs = ['loudly', 'queitly', 'well', 'badly'] for _ in range(4): article = random.choice(articles) noun = random.choice(nouns) verb = random.choice(verbs) adverb = random.choice(adverbs) sentype = random.randint(0, 1) if sentype == 0: sentense = "{} {} {} {}".format(article, noun, verb, adverb) else: sentense = "{} {} {}".format(article, noun, verb ) print(sentense)
java, so its syntax seemed too unreadable - Flippy