from random import * #generate a random sentence def word_soup(): nouns=["fox","pork chop","computer","movie star","cow","politician"] adjectives=["quick","lazy","gorgeous","tasty","mellow","crippling","outrageous"] verbs=["jumped","strode","crashed","flew","sashayed","sailed"] prepositions=["around","into","through","over","past","under","out of","with"] #the sentence form is # The ADJECTIVE ADJECTIVE NOUN VERB PREPOSITION the #ADJECTIVE NOUN. nounlength=len(nouns) adjlength=len(adjectives) verblength=len(verbs) preplength=len(prepositions) noun1=nouns[int(nounlength*random())] noun2=nouns[int(nounlength*random())] adj1=adjectives[int(adjlength*random())] adj2=adjectives[int(adjlength*random())] adj3=adjectives[int(adjlength*random())] prep=prepositions[int(preplength*random())] verb=verbs[int(verblength*random())] sentence="The "+adj1+" "+adj2+" "+noun1+" "+verb sentence=sentence+" "+ prep+" the "+adj3+" "+noun2+"." return sentence