title: Caesar Cipher Python - Additional Features
body: <p>So currently, my code looks like this (thanks to help in another post I made)</p>
  
  <pre><code>phrase = raw_input("Enter text to Cipher: ")
  shift = int(raw_input("Please enter shift: "))
  result = ("Encrypted text is: ")
  
  for character in phrase: 
       #Loops through phrase and shows ascii numbers, example: hello is: 104,101,108,108,111
      x = ord(character)
  
       #adds a shift to each character so if shift is 1 'hello' becomes: ifmmp 105,102,109,109,112
      result += chr(x + shift)
  
  
  print "\n",result,"\n"
  </code></pre>
  
  <p>The problem is, if I type in more than one word for example: hello world , with a shift of 1</p>
  
  <p>the output is: <code>ifmmp!xpsme</code></p>
  
  <p>The exclamation mark shows up for a space (varies depending on shift). I was thinking of doing an if statement to detect spaces:</p>
  
  <pre><code>phrase = raw_input("Enter text to Cipher: ")
  shift = int(raw_input("Please enter shift: "))
  result = ("Encrypted text is: ")
  
  for character in phrase: 
          #Loops through phrase and shows ascii numbers, example: hello is: 104,101,108,108,111
      x = ord(character)
  
      if x == ord(' '):
          print "\nfound a space space"
  
          #adds 1 to each character so 'hello' becomes: ifmmp 105,102,109,109,112
      result += chr(x + shift)
  
  
  print "\n",result,"\n"
  </code></pre>
  
  <p>But I don't know how to add the space into the result variable. Also, I saw in this thread: <a href="https://stackoverflow.com/questions/1538935/caesars-cipher-using-python-could-use-a-little-help">Caesar&#39;s Cipher using python, could use a little help</a></p>
  
  <p>That JeffB used a while loop for dealing with the ASCII table 32 being space and 127 being DEL. Why did he use 96? I don't understand.</p>
  
  <pre><code>while x &lt; 32:
      x += 96
  
  while x &gt; 127:
      x -= 96
  </code></pre>
  
  <p>Sorry this question is rather long. Many thanks in advance! Your help is invaluable to me.</p>