title: python list indices must be integers not string
body: <p>I'm trying to write a basic algorithm for encrypting a file. It takes the ASCII value of each character in a string and moves it up or down an amount depending on how long the password is, then you can layer more passwords on top.</p>
  
  <pre><code>def encrypt(s):
      lenStr=s.__len__() #used later for working how far the int is moved
      s=list(s) #converts the string to a list
      for x in s:
          s[x]=ord(s[x]) #the same index of the list is = to the value of the string
          s[x]=chr(s[x])#is where it eventualy gets changed back to a str
  </code></pre>
  
  <p><code>s=ord(s)</code> is the line which is throwing the error, i added int() around it but didnt help, same error</p>