input: Write a function to encrypt and decrypt a string using a shift cipher.
  assert encrypt("hello world", 3) == "khoor zruog"
  assert decrypt("khoor zruog", 3) == "hello world"
  assert encrypt("xyz", 3) == "abc"
  assert decrypt("abc", 3) == "xyz"
output: def encrypt(text, shift):
      result = ""
      for char in text:
          if char.isalpha():
              shift_amount = shift % 26
              shifted_char = chr(((ord(char.lower()) - 97 + shift_amount) % 26) + 97)
              result += shifted_char if char.islower() else shifted_char.upper()
          else:
              result += char
      return result
  
  def decrypt(text, shift):
      return encrypt(text, -shift)