title: While loop Invalid syntax
body: <p>I'm trying to use this code to create a while loop from a string, but it's not working. This is the string that I call with the eval() function:</p>
  
  <pre><code>    'while True:\n\vprint("What role do you want?")\n\vAnswer = Reformat(raw_input())\n\vif Answer in RoleArray:\n\v\vPlayArray[0].append(Answer)\n\vif Answer == "Mafia":\n\v\v\vMafia.append(User)\n\v\velif Answer == "Sheriff":\n\v\v\vSheriff = User\n\v\velif Answer == "Doctor":\n\v\v\vDoctor = User\n\v\vdel RoleArray[RoleArray.index(Answer)]\n\velse:\n\v\vprint("That is not a role. Please check you spelling. [Mafia/Sheriff/Doctor/Townsperson]")'
  </code></pre>
  
  <p>And this is the error that shows up:</p>
  
  <pre><code>    Traceback (most recent call last):
  File "&lt;pyshell#2&gt;", line 1, in &lt;module&gt;
  eval('while True:\n\vprint("What role do you want?")\n\vAnswer = Reformat(raw_input())\n\vif Answer in RoleArray:\n\v\vPlayArray[0].append(Answer)\n\vif Answer == "Mafia":\n\v\v\vMafia.append(User)\n\v\velif Answer == "Sheriff":\n\v\v\vSheriff = User\n\v\velif Answer == "Doctor":\n\v\v\vDoctor = User\n\v\vdel RoleArray[RoleArray.index(Answer)]\n\velse:\n\v\vprint("That is not a role. Please check you s')
  File "&lt;string&gt;", line 1
  while True:
      ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>There is an alternate way to execute this code properly, but I would like to know why it isn't working.
  Thanks.</p>