title: Simple encryption program
body: <p>I'm having some problems writing a simple encryption/decryption program in python, simply involving replacing the elements of one array with another. I have two arrays, the array that needs to be encrypted and the key where the first element is equivalent to a and the last to z.</p>
  
  <p>I'm assuming I will need to make all instances of a in the first array = key[0], and so on, but I don't know how to go about writing some code. Some hints or guidance would be much appreciated.</p>
  
  <p>Note that I can't import any libraries, and I have not been taught dictionaries.</p>
  
  <p>Follow up question, but related question. How would I replace all elements of the same value in a list. i.e. How would I replace all of the 'a' values in the text list with the first value of the key list?</p>
  
  <pre><code>for c in text:        
      if c == 'a':
          c = key[0]            
  </code></pre>
  
  <p>Gives me an error: 'function' object is not subscriptable</p>