title: Brute Force Script
body: <p>I am creating a simple brute force script, but I can't quite seem to figure it out. I am using the accepted answer from <a href="https://stackoverflow.com/questions/11367553/brute-force-script-in-python-3-2">this question</a>, but I can't get 'attempt' to equal the user password. Below is the code I have used (from the linked question), and changed it a little.</p>
  
  <pre><code>from string import printable
  from itertools import product
  
  user_password = 'hi' # just a test password
  for length in range(1, 10): # it isn't reasonable to try a password more than this length
      password_to_attempt = product(printable, repeat=length)
      for attempt in password_to_attempt:
          if attempt == user_password:
              print("Your password is: " + attempt)
  </code></pre>
  
  <p>My code just runs until it hits the end of the Cartesian, and never prints the final answer. Not sure what is going on.</p>
  
  <p>Any help would be appreciated!</p>