Need help making a "compliment generator"
<p>I'm trying to make a simple compliment generator that takes a noun and an adjective from two separate list ands randomly combines them together. I can get one on its own to work but trying to get the second word to appear makes weird stuff happen. What am I doing wrong here? any input would be great.</p>

<pre><code>import random
sentence = "Thou art a *adj *noun."
sentence = sentence.split()
adjectives = ["decadent", "smelly", "delightful", "volatile", "marvelous"]
indexCount= 0
noun = ["dandy", "peaseant", "mule", "maiden", "sir"]
wordCount= 0
for word in sentence:
    if word =="*adj":
        wordChoice = random.choice (adjectives)
        sentence [indexCount] = wordChoice
    indexCount += 1

for word in sentence:
     if "*noun" in word:
        wordChoice = random.choice (noun)
        sentence [wordCount] = wordChoice
     wordCount += 1
st =""
for word in sentence:
    st+= word + " "
print (st)    
</code></pre>

<p>The end result nets me a double noun. how would I get rid of the duplicate?</p>

<p>You aren't incrementing <code>wordCount</code> in the second loop as you do <code>indexCount</code> in the first.</p>

python python-3.x