input: Write a function to encrypt a message using a Caesar cipher. The function should take a message and a shift as arguments and return the encrypted message. The shift is applied to each character and if the shifted character code goes beyond the printable ASCII range (32-126), it should wrap around. If the message is empty, return an empty string.
  assert caesar_encrypt("Hello", 3) == "Khoor"
  assert caesar_encrypt("abcd", 1) == "bcde"
  assert caesar_encrypt("XYZ", 3) == "[\]^"
  assert caesar_encrypt("123", 2) == "345"
  assert caesar_encrypt("", 5) == ""
output: def caesar_encrypt(message, shift):
      if not message:
          return ""
      encrypted_message = []
      for char in message:
          new_char = chr(((ord(char) - 32 + shift) % 95) + 32)
          encrypted_message.append(new_char)
      return ''.join(encrypted_message)