title: Can Python edit individual list items?
body: <p>I wrote a program that selects random words from lists to make a sentence. I want to write grammar rules for this. Right now I am working on plurals.</p>
  
  <p>I want to add an s or es to the end of the selected word in 'nouns' if the word "those" is selected from list5. </p>
  
  <pre><code>import random   
  class Wrds(object):
  
      verbs = [
          "walk", "run"           
      ]
  
      pronouns = [
          "I", "you"
      ]
  
      help_verbs = [
          "will", "might"
      ]
  
      nouns = [
      "boy", "girl"
      ]
  
      list5 = [
      "the", "that", "this", "a", "those"
      ]
  
      punctuation = [
         ".", "?", "!"
      ]
  
      def result(self):
          a = random.choice(Wrds.verbs)
          b = random.choice(Wrds.pronouns)
          c = random.choice(Wrds.help_verbs)
          d = random.choice(Wrds.nouns)
          e = random.choice(Wrds.list5)
          f = random.choice(Wrds.punctuation)     
          print "%s %s %s %s %s%s" % (b, c, a, e, d, f)
  
  def ask():
  
      a = raw_input("&gt; ")
      if a == "go":   
          w = Wrds()
          return w.result()
  
      elif a == "exit":
          exit()
  
  while True:         
      ask()
  </code></pre>