title: Python 2.7 - AI program
body: <p>Im making an artificial intelligence program. (of sorts)
  so far all it does is, it prints the variable, and replicates itself if the var equals 0. If it equals anything else then it prints the var and asks you to exit. the only problem is, it keeps running itself and my tired eyes cant seem to find out why. can anyone help me figure out why it just keeps running? </p>
  
  <p>heres my code:</p>
  
  <pre><code>import os
  
  def AI():
      var = 0
  
      if var == 0:
          var += 1
          print ("var equals 0")
          filename = raw_input("Name your file: ")
          filesave = raw_input("Location of your file: ")
          fptr = open(filesave + filename, "w")
          fptr.write(AI())
      else:
          print ("var equals " + str(var))
          exit = raw_input("exit?")
  AI()
  </code></pre>