title: Try statement not running correctly?
body: <p>I was making a simple program that checks if a password is correct or not, in a loop. I noticed that my <strong>try</strong> statement wasn't working. Here is my code:</p>
  
  <pre><code>listfile = open("list.txt","r")
  def trial():
      for code in listfile:
          try:
              google.login(victim,"none")
              print("test")
              print("[!]Trial and error complete. Password is: %s"%code)
              break
          except smtplib.SMTPAuthenticationError:
              print("test")
              print("Incorrect password:%s"%code)
  trial()
  </code></pre>
  
  <p>I know the <strong>try</strong> statement is working. I tested it by adding the line <code>print("Test")</code> but it did not show up when I ran it.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The try statement is now running, but it always raises an error. I know that it is doing this because it is running lines 10 and 11, by printing "Incorrect password:". I saw that it printed "Inncorrect password:" even when the password that was entered was right.</p>