title: In Python 2, creating a random question from shuffled numbers
body: <p>I hope I can get some help with this, I've had absolutely no luck looking online. well that and the fact I'm new to Python. </p>
  
  <p>I'm going through Learn Python The Hard Way, and am really starting to like python. So I made a simple little game. I'm looking for a way to "cheat death", and my idea is that to escape death, you need to answer a math question, and if you get it right, you'd go back to start(), or if you dot it wrong, you'd go to dead(). So here's the code that I have for this question so far:</p>
  
  <pre><code>from random import shuffle
  
  numbers = [1, 75, 64, 80275, 2, 7]
  
  shuffle(numbers)
  
  def question(numbers):
  </code></pre>
  
  <p>Now from here, using my list of numbers, I con't quite know how to import the shuffled numbers. I am thinking to have a preset question like this:</p>
  
  <pre><code>__ + __ / __ * __ - __ * __
  </code></pre>
  
  <p>So that it'll bring in the list of numbers that've been shuffled, and then substitute __ for the corresponding __ in the question. Then, I'll have:</p>
  
  <pre><code>print "Your answer:"
  user_answer = raw_input("&gt; ")
  </code></pre>
  
  <p>So they can put in their answer. After this, I will need a way to verify the answer, so I'll do this:</p>
  
  <pre><code>if useranswer == answer:
      print "You lived!"
      start()
  else:
      dead()
  </code></pre>
  
  <p>Where the variable 'answer' is what python will return as the answer. So, at the end, here's something I think the code should look like:</p>
  
  <pre><code>from random import shuffle
  
  numbers = [1, 75, 64, 80275, 2, 7]
  
  question = shuffle(numbers)
  
  def cheat_death(numbers):
      answer = __ + __ / __ * __ - __ * __
      print "You have one chance to cheat death.\nTo do this, you must answer the following question:"
      print question
      user_answer = raw_input("&gt; ")
  
      if user_answer == answer:
          start()
      else:
          dead()
  </code></pre>
  
  <p>Ok, I have a working piece of code. It generates random numbers, and then puts them into a question. here's the code:</p>
  
  <pre><code>i = 0
  numbers = []
  
  while i &lt; 6:
      numbers.append(random.randrange(1,900))
  
      i = i + 1
  
  
  def cheat_death(numbers):
      shuffle(numbers)
      question = "%d + %d / %d * %d - %d * %d" % tuple(numbers)
      print "You have a single chance to cheat death. To live, please answer the question correctly below:"
      print question
      answer = eval(question)
      user_answer = raw_input("&gt; ")
      if user_answer == answer:
          start()
      else:
          dead()
  
  cheat_death()
  </code></pre>
  
  <p>But every single time I enter an answer, whether it's right or not, it says it's wrong. Could this be because of the eval(question)? Or man I just don't know!</p>