title: Python text encryption: rot13
body: <p>I am currently doing an assignment that encrypts text by using rot 13, but some of my text wont register.</p>
  
  <pre><code># cgi is to escape html
  # import cgi
  
  def rot13(s):
      #string encrypted
      scrypt=''
      alph='abcdefghijklmonpqrstuvwxyz'
      for c in s:
          # check if char is in alphabet
          if c.lower() in alph:
              #find c in alph and return its place
              i = alph.find(c.lower())
  
              #encrypt char = c incremented by 13
              ccrypt = alph[ i+13 : i+14 ]
  
              #add encrypted char to string
              if c==c.lower():
                  scrypt+=ccrypt
              if c==c.upper():
                  scrypt+=ccrypt.upper()
  
          #dont encrypt special chars or spaces
          else:
              scrypt+=c
  
      return scrypt
      # return cgi.escape(scrypt, quote = True)
  
  
  given_string = 'Rot13 Test'
  print rot13(given_string) 
  </code></pre>
  
  <h3>OUTPUT:</h3>
  
  <pre><code>13 r
  [Finished in 0.0s]
  </code></pre>