title: Trying to not convert spaces with 'ord()' in Python
body: <p>So I'm trying to write code that will convert a text file into numbers, and then add an offset factor to it to change the lettering when later converted into ASCII - everything works swell until I have to not convert the spaces into a number using 'ord(x)'</p>
  
  <p>Here is the code:</p>
  
  <pre><code>def TextFileEncyption(OFkey, Str):
      '''This will convert the text file that the user inputted earlier, using the offset factor to do so'''
      Message = ""
      print("The program is now going to encrypt your chosen text file...")
      for x in Str:
          if x == 32:
              pass
          else:
              number = ord(x)
          newNumber = number+OFkey
          if newNumber &gt; 126:
              newNumber = newNumber - 94
          ASCIIletter = chr(newNumber)
          Message += ASCIIletter
      print(Message)
  </code></pre>
  
  <p>I've tried the code as <code>'If x == space'</code> (where space is a variable as <code>space = " "</code>), and code like <code>'If x == " "'</code>.</p>
  
  <p>How can I best solve this problem? Thanks</p>