title: How to check for valid sequence input?
body: <pre><code>import re
  
  def check_input():
      while True:
          try:
              sequence = raw_input("Please input:")
              if sequence = [a,t,c,g]:  # checking for valid input
                  continue
              else:
                  print("invalid input, sequence coule only contain the "
                        "following letters (a,t,c,g)"):
  check_input()
  </code></pre>
  
  <p>I basically want the script to check the user's input whether it contains only these four letters (a,t,c,g). If their input contains anything other than that four letters, it could print that second statement and prompt the user to input again. I saw there are similar questions and I already tried to change my script according to those posts but it still gives me the invalid syntax error at the <code>if &lt; sequence</code> position. Anyone knows what's wrong here?</p>