title: Turning a random choice answer to and if statment
body: <p>I am creating  text based game in python 3.3.2 and I want to display a message depending on what happens after the attack either misses or hits <em>(chosen randomly)</em>, you get a different message depending on what happens. this is the code so far                </p>
  
  <pre><code>print ("A huge spider as large as your fist crawls up your arm. Do you attack it? Y/N")
  attack_spider = input ()
  #North/hand in hole/keep it in/attack
  if attack_spider == "Y":
     attack = ['Miss', 'Miss', 'Miss', 'Miss', 'Hit']
     from random import choice
     print (choice(attack))
  </code></pre>
  
  <p>I think it looks like this:</p>
  
  <pre><code>if attack == 'Miss':
     print ("You made the spider angry")
  </code></pre>
  
  <p>but this does not seen to work. is it possible to do this?</p>
  
  <p>I added the code in the answer below like so:</p>
  
  <pre><code>               if attack_spider == "Y":
                     attack = ['Miss', 'Miss', 'Miss', 'Miss', 'Hit']
                     from random import choice
                     print (choice(attack))
                     messages = {
                     "Miss": "You made the spider angry!",
                     "Hit": "You killed the spider!"
                      }
                     print messages[choice(attack)]
  </code></pre>
  
  <p>but know when I run the program I get the error like so:</p>
  
  <p>syntax error and highlights messages</p>
  
  <p>did I just add the code wrong or it it something elese</p>