title: I tried this password finder in python but something went wrong
body: <p>i am new to python and i have been trying stuff to learn. I tried this password finder thingy and it works for 5 seconds than starts giving errors. What did i do wrong</p>
  <pre><code>import random
  import time
  import sys
  import string
  
  sys.setrecursionlimit(10000)
  
  guessPass = ''
  
  mypass = 'A87C235n'
  
  lettersList = list(string.ascii_letters)
  
  
  def SetPassword():
      global guessPass
      guessPass = ''
      for i in range(8):
          x = random.randint(0,1)
          if x == 0:
              guessPass += lettersList[random.randint(0,len(lettersList))]
          else:
              guessPass += str(random.randint(0,9))
      if (guessPass == mypass):
          print('Success i found the pass')
          print(guessPass)
      else:
          print(guessPass)
          time.sleep(0.1)
          SetPassword()
  
  SetPassword()
  </code></pre>
  <p>This is the error:</p>
  <pre><code>&gt; 1U1ix2x7
  gJhzH308
  Rd2657V4
  97h6S0D8
  40M0O066
  i6C428G3
  55085E95
  1ggU17o1
  3GCt5cv7
  2SAj68lE
  lSw8I3xV
  667Lvwh5
  x9D3u77o
  677n5022
  53S6Az5w
  F61KqP3K
  K44VP2f9
  V9oaz83N
  L42zM1N9
  020gI0L4
  0y26O0Xu
  316O8aE9
  JhJ183t5
  929tN851
  519E99uU
  ybV5o021
  0Osnij1J
  Z9rwET0l
  43H218G6
  0lx733t0
  8jj0323P
  5rE41639
  4kb7Y2HB
  Nf5m9EMf
  0a6OWD0D
  63P5H144
  m8HURuZN
  896Dw57K
  H43AGh2Q
  i0R78H7A
  fkh80236
  1Ok88eF9
  o1bXq7N7
  4S2h174v
  301Bb204
  R6LC3m7N
  g0Cpst1M
  W93W70x8
  Traceback (most recent call last):
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 32, in &lt;module&gt;
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 30, in SetPassword
      SetPassword()
    File &quot;/Users/apple/Desktop/PythonEmir/69420&quot;, line 21, in SetPassword
      guessPass += lettersList[random.randint(0,len(lettersList))]
  IndexError: list index out of range
  [Finished in 5.016s]
  </code></pre>