import random def paragraph(min=1, max=20): def sentence(): nouns = ["time", "person", "year", "way", "day", "thing", "man", "world", "life", "hand", "part", "child", "eye", "woman", "place", "work", "week", "case", "point", "government", "company", "number", "group", "problem", "fact"] verbs = ["be", "have", "do", "say", "get", "make", "go", "know", "take", "see", "come", "think", "look", "want", "give", "use", "find", "tell", "ask", "work", "seem", "feel", "try", "leave", "call"] adjectives = ["good", "new", "first", "last", "long", "great", "little", "own", "other", "old", "right", "big", "high", "different", "small", "large", "next", "early", "young", "important", "few", "public", "bad", "same", "able"] prepositions = ["to", "of", "in", "for", "on", "with", "at", "by", "from", "up", "about", "into", "over", "after", "beneath", "under", "above"] adverbs = ["and", "therefore", "then", "but", "while", "so", "in order to", "thereafter", "also", "besides", "consequently", "finally", "hence", "in addition", "However", "furthermore", "meanwhile", "likewise", "instead", "indeed"] def maker(): words = [] if random.choice([1,0,0]): # 1 out of 3 words.append(random.choice(prepositions)) if random.choice([1,0,0]): # 1 out of 3 words.append(random.choice(adjectives)) words.append(random.choice(nouns)) words.append(random.choice(verbs)) if random.choice([1,0,0]): # 1 out of 3 words.append(random.choice(prepositions)) if random.choice([1,1,0]): # 2 out of 3 words.append(random.choice(adjectives)) words.append(random.choice(nouns)) return words words = maker() if random.choice([1,0,0]): # 1 out of 3 words.append(random.choice(adverbs)) words += maker() return ' '.join(words).capitalize() sentences = [] for x in range(random.randrange(min,max)): sentences.append(sentence()) return '. '.join(sentences) + random.choice('??!...')