title: How do you make use of a counter with recursion in Python?
body: <p>I'm trying to write a simple "password" program in Python that allows 3 attempts at "logging in" with a recursive function. I can't figure out why it's not working though... (And yes, Jurassic Park inspired)</p>
  
  <pre><code>def magicWord(count):
      int(count)
      answer = raw_input("What is the password? ")
      if answer == 'lucas':
          print 'ACESS GRANTED'
      else:
          count =+ 1
          if count &gt; 2:
              while count &gt; 2:
                  count+=1
                  print "na na na you didn\'t say the magic word. "
          else:
              magicWord(count)
  
  magicWord(0)
  </code></pre>