title: Using "random" in a python prog. with "while", "if" and elif"
body: <p>Apologies in advance for the Python 101 nature of this question. I have yet to wrap my mind around while loops. </p>
  
  <p>This example is a homework assignment from a book for beginners: </p>
  
  <p>Write a program that randomly opens different fortune cookies and prints each message. The user only needs to hit 'enter' to open one cookie after another.    </p>
  
  <p>Here is what I have so far...</p>
  
  <pre><code>import random
  cookie_number=random.randrange(3)+1
  prompt=""
  while not prompt:
      prompt=input("Open Cookie")
  
  if cookie_number==1:
      print("your lucky numbers are 3, 22, 107")
  
  elif cookie_number==2:
      print("you are lucky in love today")
  
  elif cookie_number==3:
      print("buy stocks today")
  
  else:
      print("stay away from MSG")
  </code></pre>