title: Why Isn't This L-System Code Returning a String?
body: <p>I'm trying to write a program that takes a string and replaces certain characters with other strings. (A->AB) and (B->A) in this case. When I run it I expect the final string to be returned but instead nothing is returned.</p>
  
  <pre><code>def createSystem(seed,depth):
  
      startString = seed
      endString = ""
  
      for i in range(depth): 
          endString = processString(startString)
          startString = endString
      return endString   
  
  
  def processString(oldstr):
      newstr=""
      for char in oldstr:
          newstr=newstr+applyrules(oldstr)
  
      return(newstr)
  
  def applyrules(oldstr):
      output=""
  
      for char in oldstr:
          if char=="A":
              output.join("AB")
          elif char=="B":
              output.join("A")
  
      return(output)
  
  
  print(createSystem("AB",1))
  </code></pre>
  
  <p>In this example I would expect the seed "AB" to produce the string "ABA", however nothing is returned to the console. Why is this? Thanks in Advance! - Eli</p>
  
  <p>EDIT: The program compiles and doesn't produce any errors.</p>