text: """
  File: encrypt_and_decrypt.py
  Encypts an input string of lowercase letters and prints
  the result. The other input is the distance value.
  
  Next, the output of the encrpyted string is decrypted 
  back to lowercase letters and the result is printed. 
  The other input is the distance value.
  """
  
  plainText = input("Enter a one-word, lowercase message: ")
  distance = int(input("Enter the distance value: "))
  code = ""
  for ch in plainText:
      ordValue = ord(ch)
      cipherValue = ordValue + distance
      if cipherValue > ord('z'):
          cipherValue = ord('a') + distance - \
              (ord('z') - ordValue + 1)
      code += chr(cipherValue)
  print('\n' + 'encrypted message: ', code)
  
  plainText = ''
  for ch in code:
      ordValue = ord(ch)
      cipherValue = ordValue - distance
      if cipherValue < ord('a'):
          cipherValue = ord('z') - (distance -
                                    (ordValue - ord('a')) - 1)
      plainText += chr(cipherValue)
  print('decrypted message: ', plainText)
  