Beginner: While loop not functioning properly, syntax errors, displays nothing
<p>I am working through some Looping exercises, While statements in particular. Here are the instructions:</p>

<blockquote>
  <p>2.2) Modify the program so that it asks users whether they want to guess again each time. Use two variables, number for the number and answer for the answer to the question whether they want to continue guessing. The program stops if the user guesses the correct number or answers "no". (In other words, the program continues as long as a user has not answered "no" and has not guessed the correct number.)</p>
</blockquote>

<p>Here is my code:</p>

<pre><code>#!usr/bin/env python
#
#While statement

number = 24

while number != 24:
    answer = raw_input("Guess my lucky number! Do you want to keep guessing?")

    if number == 24:
       print "You got it! That is great!"

    elif answer == "no":
       print "Thank you for playing."

    else:
       print "That is not the right answer! Try again."
</code></pre>

<p>When I run the module in IDLE, the end quote of That is great!" - becomes red and says invalid syntax. In terminal if I run $ python while.py nothing loads. I've tried writing this as Python 3 functions with print("") but it still does not run.</p>

<p>Thanks to anyone who can help with this.</p>
